Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / attachment / attachment.rpc.js
index f43f10f..3b13eeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1fd=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x17542e,_0x497c31){_0x17542e=_0x17542e-0x0;var _0x28c798=_0xa1fd[_0x17542e];return _0x28c798;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var moment=require(_0xda1f('0x2'));var BPromise=require(_0xda1f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda1f('0x4'));var db=require(_0xda1f('0x5'))['db'];var utils=require(_0xda1f('0x6'));var logger=require(_0xda1f('0x7'))(_0xda1f('0x8'));var config=require('../../config/environment');var jayson=require(_0xda1f('0x9'));var client=jayson[_0xda1f('0xa')][_0xda1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552ba4,_0x33502e,_0x46a29e){return new BPromise(function(_0x199a8d,_0x338463){return client[_0xda1f('0xc')](_0x552ba4,_0x46a29e)[_0xda1f('0xd')](function(_0x1493f8){logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,'request\x20sent');logger[_0xda1f('0x10')](_0xda1f('0x11'),_0x33502e,_0xda1f('0x12'),JSON[_0xda1f('0x13')](_0x1493f8));if(_0x1493f8['error']){if(_0x1493f8['error'][_0xda1f('0x14')]===0x1f4){logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x338463(_0x1493f8['error'][_0xda1f('0x16')]);}logger[_0xda1f('0x15')](_0xda1f('0xf'),_0x33502e,_0x1493f8[_0xda1f('0x15')][_0xda1f('0x16')]);return _0x199a8d(_0x1493f8[_0xda1f('0x15')]['message']);}else{logger[_0xda1f('0xe')](_0xda1f('0xf'),_0x33502e,_0xda1f('0x12'));_0x199a8d(_0x1493f8[_0xda1f('0x17')]['message']);}})['catch'](function(_0x3020ea){logger['error'](_0xda1f('0xf'),_0x33502e,_0x3020ea);_0x338463(_0x3020ea);});});}exports[_0xda1f('0x18')]=function(_0x1e10af){var _0x59b7bf=this;return new Promise(function(_0xe81fc2,_0xe18a0a){return db['Attachment'][_0xda1f('0x19')](_0x1e10af[_0xda1f('0x1a')],{'raw':_0x1e10af['options']?_0x1e10af[_0xda1f('0x1b')][_0xda1f('0x1c')]===undefined?!![]:![]:!![]})[_0xda1f('0xd')](function(_0xe85e94){logger[_0xda1f('0xe')](_0xda1f('0x18'),_0x1e10af);logger[_0xda1f('0x10')](_0xda1f('0x18'),_0x1e10af,JSON[_0xda1f('0x13')](_0xe85e94));_0xe81fc2(_0xe85e94);})[_0xda1f('0x1d')](function(_0x1d510b){logger[_0xda1f('0x15')]('CreateAttachment',_0x1d510b[_0xda1f('0x16')],_0x1e10af);_0xe18a0a(_0x59b7bf['error'](0x1f4,_0x1d510b[_0xda1f('0x16')]));});});};
\ No newline at end of file
+var _0xa4db=['catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','raw','CreateAttachment'];(function(_0x1ffc2a,_0x5d14fc){var _0x14f6cb=function(_0x436cc1){while(--_0x436cc1){_0x1ffc2a['push'](_0x1ffc2a['shift']());}};_0x14f6cb(++_0x5d14fc);}(_0xa4db,0x139));var _0xba4d=function(_0x485161,_0x3476){_0x485161=_0x485161-0x0;var _0x1ac81c=_0xa4db[_0x485161];return _0x1ac81c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xba4d('0x0'));var rs=require(_0xba4d('0x1'));var fs=require('fs');var Redis=require(_0xba4d('0x2'));var db=require(_0xba4d('0x3'))['db'];var utils=require(_0xba4d('0x4'));var logger=require(_0xba4d('0x5'))('rpc');var config=require(_0xba4d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xba4d('0x7')][_0xba4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x325531,_0x14b2fd,_0x2c8823){return new BPromise(function(_0xdfc6bf,_0x2171f4){return client[_0xba4d('0x9')](_0x325531,_0x2c8823)[_0xba4d('0xa')](function(_0x4823a9){logger[_0xba4d('0xb')](_0xba4d('0xc'),_0x14b2fd,_0xba4d('0xd'));logger[_0xba4d('0xe')](_0xba4d('0xf'),_0x14b2fd,_0xba4d('0xd'),JSON[_0xba4d('0x10')](_0x4823a9));if(_0x4823a9[_0xba4d('0x11')]){if(_0x4823a9[_0xba4d('0x11')][_0xba4d('0x12')]===0x1f4){logger[_0xba4d('0x11')](_0xba4d('0xc'),_0x14b2fd,_0x4823a9['error']['message']);return _0x2171f4(_0x4823a9['error'][_0xba4d('0x13')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0x4823a9[_0xba4d('0x11')][_0xba4d('0x13')]);return _0xdfc6bf(_0x4823a9[_0xba4d('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0xba4d('0xd'));_0xdfc6bf(_0x4823a9[_0xba4d('0x14')][_0xba4d('0x13')]);}})['catch'](function(_0x4ef915){logger['error']('Attachment,\x20%s,\x20%s',_0x14b2fd,_0x4ef915);_0x2171f4(_0x4ef915);});});}exports['CreateAttachment']=function(_0x5e533a){var _0x3a639f=this;return new Promise(function(_0x4c9f27,_0x318a77){return db['Attachment']['create'](_0x5e533a['body'],{'raw':_0x5e533a['options']?_0x5e533a['options'][_0xba4d('0x15')]===undefined?!![]:![]:!![]})[_0xba4d('0xa')](function(_0x4ea891){logger['info'](_0xba4d('0x16'),_0x5e533a);logger['debug'](_0xba4d('0x16'),_0x5e533a,JSON[_0xba4d('0x10')](_0x4ea891));_0x4c9f27(_0x4ea891);})[_0xba4d('0x17')](function(_0x46f7ff){logger[_0xba4d('0x11')](_0xba4d('0x16'),_0x46f7ff[_0xba4d('0x13')],_0x5e533a);_0x318a77(_0x3a639f[_0xba4d('0x11')](0x1f4,_0x46f7ff[_0xba4d('0x13')]));});});};
\ No newline at end of file