Built motion from commit ce03bc3d.|2.5.39
[motion2.git] / server / api / attachment / attachment.rpc.js
index b949f01..34618e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83f1=['CreateAttachment','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Attachment','create','options','raw'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x83f1,0x1cc));var _0x183f=function(_0x1d190d,_0x4cafc5){_0x1d190d=_0x1d190d-0x0;var _0x493ca1=_0x83f1[_0x1d190d];return _0x493ca1;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var moment=require(_0x183f('0x2'));var BPromise=require(_0x183f('0x3'));var rs=require(_0x183f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x183f('0x5'));var logger=require(_0x183f('0x6'))(_0x183f('0x7'));var config=require(_0x183f('0x8'));var jayson=require(_0x183f('0x9'));var client=jayson['client'][_0x183f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf702f5,_0x364cc4,_0x5c75c3){return new BPromise(function(_0x434be2,_0x5bdf95){return client[_0x183f('0xb')](_0xf702f5,_0x5c75c3)[_0x183f('0xc')](function(_0x37ed60){logger[_0x183f('0xd')](_0x183f('0xe'),_0x364cc4,_0x183f('0xf'));logger[_0x183f('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'),JSON[_0x183f('0x11')](_0x37ed60));if(_0x37ed60[_0x183f('0x12')]){if(_0x37ed60[_0x183f('0x12')][_0x183f('0x13')]===0x1f4){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60['error'][_0x183f('0x14')]);return _0x5bdf95(_0x37ed60['error']['message']);}logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0x37ed60[_0x183f('0x12')][_0x183f('0x14')]);return _0x434be2(_0x37ed60[_0x183f('0x12')]['message']);}else{logger[_0x183f('0xd')]('Attachment,\x20%s,\x20%s',_0x364cc4,_0x183f('0xf'));_0x434be2(_0x37ed60[_0x183f('0x15')][_0x183f('0x14')]);}})['catch'](function(_0xe9c5d9){logger[_0x183f('0x12')](_0x183f('0xe'),_0x364cc4,_0xe9c5d9);_0x5bdf95(_0xe9c5d9);});});}exports['CreateAttachment']=function(_0x284244){var _0x2b819e=this;return new Promise(function(_0x2c3468,_0x3f713f){return db[_0x183f('0x16')][_0x183f('0x17')](_0x284244['body'],{'raw':_0x284244[_0x183f('0x18')]?_0x284244[_0x183f('0x18')][_0x183f('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x26a103){logger['info'](_0x183f('0x1a'),_0x284244);logger[_0x183f('0x10')](_0x183f('0x1a'),_0x284244,JSON[_0x183f('0x11')](_0x26a103));_0x2c3468(_0x26a103);})['catch'](function(_0x3a1bec){logger[_0x183f('0x12')](_0x183f('0x1a'),_0x3a1bec[_0x183f('0x14')],_0x284244);_0x3f713f(_0x2b819e[_0x183f('0x12')](0x1f4,_0x3a1bec[_0x183f('0x14')]));});});};
\ No newline at end of file
+var _0x6c76=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateAttachment','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s'];(function(_0x3f7d30,_0x288d25){var _0x220b4b=function(_0x4806fe){while(--_0x4806fe){_0x3f7d30['push'](_0x3f7d30['shift']());}};_0x220b4b(++_0x288d25);}(_0x6c76,0x184));var _0x66c7=function(_0x169124,_0x2d98b5){_0x169124=_0x169124-0x0;var _0x3ee0d3=_0x6c76[_0x169124];return _0x3ee0d3;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['CreateAttachment']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['Attachment'][_0x66c7('0x14')](_0x5129f6[_0x66c7('0x15')],{'raw':_0x5129f6[_0x66c7('0x16')]?_0x5129f6[_0x66c7('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1853b2){logger[_0x66c7('0xa')](_0x66c7('0x17'),_0x5129f6);logger[_0x66c7('0x18')](_0x66c7('0x17'),_0x5129f6,JSON[_0x66c7('0xe')](_0x1853b2));_0x19f29d(_0x1853b2);})['catch'](function(_0x4ddbd2){logger[_0x66c7('0xf')]('CreateAttachment',_0x4ddbd2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0x4ddbd2[_0x66c7('0x11')]));});});};
\ No newline at end of file