Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / attachment / attachment.rpc.js
index 0806329..d867baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x985a=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','lodash','util','moment'];(function(_0x46ab02,_0x5b35ac){var _0x35870d=function(_0x3f7ac8){while(--_0x3f7ac8){_0x46ab02['push'](_0x46ab02['shift']());}};_0x35870d(++_0x5b35ac);}(_0x985a,0x14d));var _0xa985=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x985a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xa985('0x0'));var util=require(_0xa985('0x1'));var moment=require(_0xa985('0x2'));var BPromise=require(_0xa985('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa985('0x4'))['db'];var utils=require(_0xa985('0x5'));var logger=require(_0xa985('0x6'))(_0xa985('0x7'));var config=require(_0xa985('0x8'));var jayson=require(_0xa985('0x9'));var client=jayson['client'][_0xa985('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xacaf3a,_0x2db7c6,_0x2dba64){return new BPromise(function(_0x29a191,_0x229a9e){return client['request'](_0xacaf3a,_0x2dba64)[_0xa985('0xb')](function(_0x29495f){logger[_0xa985('0xc')](_0xa985('0xd'),_0x2db7c6,_0xa985('0xe'));logger['debug'](_0xa985('0xf'),_0x2db7c6,'request\x20sent',JSON[_0xa985('0x10')](_0x29495f));if(_0x29495f[_0xa985('0x11')]){if(_0x29495f[_0xa985('0x11')]['code']===0x1f4){logger[_0xa985('0x11')](_0xa985('0xd'),_0x2db7c6,_0x29495f['error'][_0xa985('0x12')]);return _0x229a9e(_0x29495f['error'][_0xa985('0x12')]);}logger[_0xa985('0x11')](_0xa985('0xd'),_0x2db7c6,_0x29495f['error']['message']);return _0x29a191(_0x29495f[_0xa985('0x11')][_0xa985('0x12')]);}else{logger[_0xa985('0xc')](_0xa985('0xd'),_0x2db7c6,_0xa985('0xe'));_0x29a191(_0x29495f[_0xa985('0x13')][_0xa985('0x12')]);}})[_0xa985('0x14')](function(_0x2a0391){logger['error']('Attachment,\x20%s,\x20%s',_0x2db7c6,_0x2a0391);_0x229a9e(_0x2a0391);});});}exports[_0xa985('0x15')]=function(_0x9bd25f){var _0x1974ec=this;return new Promise(function(_0x247653,_0x5d595e){return db[_0xa985('0x16')][_0xa985('0x17')](_0x9bd25f[_0xa985('0x18')],{'raw':_0x9bd25f['options']?_0x9bd25f[_0xa985('0x19')][_0xa985('0x1a')]===undefined?!![]:![]:!![]})[_0xa985('0xb')](function(_0xc97495){logger['info'](_0xa985('0x15'),_0x9bd25f);logger[_0xa985('0x1b')](_0xa985('0x15'),_0x9bd25f,JSON[_0xa985('0x10')](_0xc97495));_0x247653(_0xc97495);})['catch'](function(_0x3f55c4){logger[_0xa985('0x11')]('CreateAttachment',_0x3f55c4[_0xa985('0x12')],_0x9bd25f);_0x5d595e(_0x1974ec[_0xa985('0x11')](0x1f4,_0x3f55c4[_0xa985('0x12')]));});});};
\ No newline at end of file
+var _0x5cf5=['../../config/environment','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment','create','body','options','CreateAttachment','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x189626,_0x396521){var _0xbfc0f1=function(_0x33b433){while(--_0x33b433){_0x189626['push'](_0x189626['shift']());}};_0xbfc0f1(++_0x396521);}(_0x5cf5,0xae));var _0x55cf=function(_0x3dec58,_0x2fb4bb){_0x3dec58=_0x3dec58-0x0;var _0x25360c=_0x5cf5[_0x3dec58];return _0x25360c;};'use strict';var _=require('lodash');var util=require(_0x55cf('0x0'));var moment=require('moment');var BPromise=require(_0x55cf('0x1'));var rs=require(_0x55cf('0x2'));var fs=require('fs');var Redis=require(_0x55cf('0x3'));var db=require(_0x55cf('0x4'))['db'];var utils=require(_0x55cf('0x5'));var logger=require(_0x55cf('0x6'))(_0x55cf('0x7'));var config=require(_0x55cf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c2de2,_0x24dff1,_0x401a38){return new BPromise(function(_0x4e6c04,_0xe33d50){return client['request'](_0x2c2de2,_0x401a38)[_0x55cf('0xa')](function(_0x2212f6){logger[_0x55cf('0xb')](_0x55cf('0xc'),_0x24dff1,_0x55cf('0xd'));logger[_0x55cf('0xe')](_0x55cf('0xf'),_0x24dff1,'request\x20sent',JSON[_0x55cf('0x10')](_0x2212f6));if(_0x2212f6[_0x55cf('0x11')]){if(_0x2212f6['error'][_0x55cf('0x12')]===0x1f4){logger[_0x55cf('0x11')]('Attachment,\x20%s,\x20%s',_0x24dff1,_0x2212f6[_0x55cf('0x11')][_0x55cf('0x13')]);return _0xe33d50(_0x2212f6[_0x55cf('0x11')][_0x55cf('0x13')]);}logger[_0x55cf('0x11')](_0x55cf('0xc'),_0x24dff1,_0x2212f6[_0x55cf('0x11')][_0x55cf('0x13')]);return _0x4e6c04(_0x2212f6[_0x55cf('0x11')][_0x55cf('0x13')]);}else{logger[_0x55cf('0xb')](_0x55cf('0xc'),_0x24dff1,'request\x20sent');_0x4e6c04(_0x2212f6[_0x55cf('0x14')][_0x55cf('0x13')]);}})['catch'](function(_0x3f0191){logger[_0x55cf('0x11')]('Attachment,\x20%s,\x20%s',_0x24dff1,_0x3f0191);_0xe33d50(_0x3f0191);});});}exports['CreateAttachment']=function(_0x339aa9){var _0x349902=this;return new Promise(function(_0x2a2bea,_0x549548){return db[_0x55cf('0x15')][_0x55cf('0x16')](_0x339aa9[_0x55cf('0x17')],{'raw':_0x339aa9[_0x55cf('0x18')]?_0x339aa9[_0x55cf('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x55cf('0xa')](function(_0x57d7cd){logger[_0x55cf('0xb')](_0x55cf('0x19'),_0x339aa9);logger[_0x55cf('0xe')]('CreateAttachment',_0x339aa9,JSON[_0x55cf('0x10')](_0x57d7cd));_0x2a2bea(_0x57d7cd);})['catch'](function(_0x5706a0){logger[_0x55cf('0x11')](_0x55cf('0x19'),_0x5706a0['message'],_0x339aa9);_0x549548(_0x349902[_0x55cf('0x11')](0x1f4,_0x5706a0[_0x55cf('0x13')]));});});};
\ No newline at end of file