Built motion from commit 6db1674d.|2.6.23
[motion2.git] / server / api / reportAgentPreview / reportAgentPreview.rpc.js
index dc6a2a3..adb9a10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x039f=['result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x1e5851,_0x429dd4){var _0x490574=function(_0x42e304){while(--_0x42e304){_0x1e5851['push'](_0x1e5851['shift']());}};_0x490574(++_0x429dd4);}(_0x039f,0x67));var _0xf039=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x039f[_0x5ac1e5];return _0x1bccc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf039('0x0'));var BPromise=require('bluebird');var rs=require(_0xf039('0x1'));var fs=require('fs');var Redis=require(_0xf039('0x2'));var db=require(_0xf039('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf039('0x4'));var jayson=require(_0xf039('0x5'));var client=jayson[_0xf039('0x6')][_0xf039('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xca2365,_0x4be8ea,_0x190d77){return new BPromise(function(_0x5c0cef,_0x13bade){return client[_0xf039('0x8')](_0xca2365,_0x190d77)[_0xf039('0x9')](function(_0x4c2895){logger[_0xf039('0xa')](_0xf039('0xb'),_0x4be8ea,'request\x20sent');logger[_0xf039('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4be8ea,'request\x20sent',JSON[_0xf039('0xd')](_0x4c2895));if(_0x4c2895[_0xf039('0xe')]){if(_0x4c2895[_0xf039('0xe')][_0xf039('0xf')]===0x1f4){logger['error'](_0xf039('0xb'),_0x4be8ea,_0x4c2895['error']['message']);return _0x13bade(_0x4c2895['error'][_0xf039('0x10')]);}logger[_0xf039('0xe')](_0xf039('0xb'),_0x4be8ea,_0x4c2895['error'][_0xf039('0x10')]);return _0x5c0cef(_0x4c2895[_0xf039('0xe')][_0xf039('0x10')]);}else{logger[_0xf039('0xa')](_0xf039('0xb'),_0x4be8ea,'request\x20sent');_0x5c0cef(_0x4c2895[_0xf039('0x11')]['message']);}})[_0xf039('0x12')](function(_0x4cbaff){logger[_0xf039('0xe')](_0xf039('0xb'),_0x4be8ea,_0x4cbaff);_0x13bade(_0x4cbaff);});});}exports[_0xf039('0x13')]=function(_0x5d346c){var _0x525cd8=this;return new Promise(function(_0x4d24bd,_0x23bc27){return db[_0xf039('0x14')]['create'](_0x5d346c[_0xf039('0x15')],{'raw':_0x5d346c[_0xf039('0x16')]?_0x5d346c[_0xf039('0x16')][_0xf039('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x17c775){logger[_0xf039('0xa')](_0xf039('0x13'),_0x5d346c);logger[_0xf039('0xc')](_0xf039('0x13'),_0x5d346c,JSON['stringify'](_0x17c775));_0x4d24bd(_0x17c775);})[_0xf039('0x12')](function(_0x507546){logger['error'](_0xf039('0x13'),_0x507546[_0xf039('0x10')],_0x5d346c);_0x23bc27(_0x525cd8[_0xf039('0xe')](0x1f4,_0x507546[_0xf039('0x10')]));});});};
\ No newline at end of file
+var _0xf773=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateReportAgentPreview','ReportAgentPreview','create','body'];(function(_0x589f82,_0x46ce05){var _0x29615f=function(_0xc04a44){while(--_0xc04a44){_0x589f82['push'](_0x589f82['shift']());}};_0x29615f(++_0x46ce05);}(_0xf773,0x154));var _0x3f77=function(_0x53dc1c,_0xa62198){_0x53dc1c=_0x53dc1c-0x0;var _0x2aff50=_0xf773[_0x53dc1c];return _0x2aff50;};'use strict';var _=require(_0x3f77('0x0'));var util=require(_0x3f77('0x1'));var moment=require(_0x3f77('0x2'));var BPromise=require(_0x3f77('0x3'));var rs=require(_0x3f77('0x4'));var fs=require('fs');var Redis=require(_0x3f77('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3f77('0x6'))('rpc');var config=require(_0x3f77('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3f77('0x8')][_0x3f77('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c4049,_0x4ecbd0,_0x3cbc43){return new BPromise(function(_0x2a855a,_0x2f215d){return client[_0x3f77('0xa')](_0x4c4049,_0x3cbc43)['then'](function(_0x5c7cee){logger[_0x3f77('0xb')](_0x3f77('0xc'),_0x4ecbd0,_0x3f77('0xd'));logger[_0x3f77('0xe')](_0x3f77('0xf'),_0x4ecbd0,'request\x20sent',JSON[_0x3f77('0x10')](_0x5c7cee));if(_0x5c7cee[_0x3f77('0x11')]){if(_0x5c7cee[_0x3f77('0x11')]['code']===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x4ecbd0,_0x5c7cee['error']['message']);return _0x2f215d(_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);}logger[_0x3f77('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x4ecbd0,_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);return _0x2a855a(_0x5c7cee[_0x3f77('0x11')][_0x3f77('0x12')]);}else{logger[_0x3f77('0xb')](_0x3f77('0xc'),_0x4ecbd0,'request\x20sent');_0x2a855a(_0x5c7cee[_0x3f77('0x13')][_0x3f77('0x12')]);}})['catch'](function(_0x24adba){logger[_0x3f77('0x11')](_0x3f77('0xc'),_0x4ecbd0,_0x24adba);_0x2f215d(_0x24adba);});});}exports[_0x3f77('0x14')]=function(_0x327eb4){var _0x4eef1a=this;return new Promise(function(_0x1aedaf,_0x1e8d7d){return db[_0x3f77('0x15')][_0x3f77('0x16')](_0x327eb4[_0x3f77('0x17')],{'raw':_0x327eb4[_0x3f77('0x18')]?_0x327eb4['options'][_0x3f77('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x37ef47){logger[_0x3f77('0xb')](_0x3f77('0x14'),_0x327eb4);logger[_0x3f77('0xe')](_0x3f77('0x14'),_0x327eb4,JSON[_0x3f77('0x10')](_0x37ef47));_0x1aedaf(_0x37ef47);})['catch'](function(_0x5303c9){logger['error'](_0x3f77('0x14'),_0x5303c9[_0x3f77('0x12')],_0x327eb4);_0x1e8d7d(_0x4eef1a[_0x3f77('0x11')](0x1f4,_0x5303c9[_0x3f77('0x12')]));});});};
\ No newline at end of file