Built motion from commit 863c3375.|2.6.28
[motion2.git] / server / api / reportAgentPreview / reportAgentPreview.rpc.js
index a435355..a3f43b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x675a=['stringify','error','code','message','info','result','catch','CreateReportAgentPreview','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x321777,_0x101b1c){var _0x4bacdb=function(_0x9b0b63){while(--_0x9b0b63){_0x321777['push'](_0x321777['shift']());}};_0x4bacdb(++_0x101b1c);}(_0x675a,0x1f0));var _0xa675=function(_0x35d2ec,_0x30848c){_0x35d2ec=_0x35d2ec-0x0;var _0x1ca87d=_0x675a[_0x35d2ec];return _0x1ca87d;};'use strict';var _=require('lodash');var util=require(_0xa675('0x0'));var moment=require(_0xa675('0x1'));var BPromise=require(_0xa675('0x2'));var rs=require(_0xa675('0x3'));var fs=require('fs');var Redis=require(_0xa675('0x4'));var db=require(_0xa675('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa675('0x6'))('rpc');var config=require(_0xa675('0x7'));var jayson=require(_0xa675('0x8'));var client=jayson[_0xa675('0x9')][_0xa675('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c9aeb,_0x5a4636,_0xc45a94){return new BPromise(function(_0x3aae41,_0x1e80b2){return client[_0xa675('0xb')](_0x3c9aeb,_0xc45a94)[_0xa675('0xc')](function(_0x37bba5){logger['info'](_0xa675('0xd'),_0x5a4636,'request\x20sent');logger[_0xa675('0xe')](_0xa675('0xf'),_0x5a4636,_0xa675('0x10'),JSON[_0xa675('0x11')](_0x37bba5));if(_0x37bba5[_0xa675('0x12')]){if(_0x37bba5[_0xa675('0x12')][_0xa675('0x13')]===0x1f4){logger[_0xa675('0x12')](_0xa675('0xd'),_0x5a4636,_0x37bba5[_0xa675('0x12')]['message']);return _0x1e80b2(_0x37bba5[_0xa675('0x12')][_0xa675('0x14')]);}logger[_0xa675('0x12')](_0xa675('0xd'),_0x5a4636,_0x37bba5[_0xa675('0x12')]['message']);return _0x3aae41(_0x37bba5[_0xa675('0x12')][_0xa675('0x14')]);}else{logger[_0xa675('0x15')](_0xa675('0xd'),_0x5a4636,_0xa675('0x10'));_0x3aae41(_0x37bba5[_0xa675('0x16')]['message']);}})[_0xa675('0x17')](function(_0xec35d1){logger['error'](_0xa675('0xd'),_0x5a4636,_0xec35d1);_0x1e80b2(_0xec35d1);});});}exports[_0xa675('0x18')]=function(_0x119a51){var _0x238204=this;return new Promise(function(_0x463f77,_0x41cca8){return db['ReportAgentPreview']['create'](_0x119a51['body'],{'raw':_0x119a51[_0xa675('0x19')]?_0x119a51[_0xa675('0x19')][_0xa675('0x1a')]===undefined?!![]:![]:!![]})[_0xa675('0xc')](function(_0x587652){logger[_0xa675('0x15')](_0xa675('0x18'),_0x119a51);logger[_0xa675('0xe')](_0xa675('0x18'),_0x119a51,JSON[_0xa675('0x11')](_0x587652));_0x463f77(_0x587652);})[_0xa675('0x17')](function(_0x59e818){logger[_0xa675('0x12')](_0xa675('0x18'),_0x59e818['message'],_0x119a51);_0x41cca8(_0x238204['error'](0x1f4,_0x59e818[_0xa675('0x14')]));});});};
\ No newline at end of file
+var _0x63f1=['../../config/environment','jayson/promise','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','info','lodash','util','moment','ioredis','../../mysqldb','rpc'];(function(_0x4b13f3,_0x15d062){var _0x295757=function(_0x547f10){while(--_0x547f10){_0x4b13f3['push'](_0x4b13f3['shift']());}};_0x295757(++_0x15d062);}(_0x63f1,0x102));var _0x163f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x63f1[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x163f('0x0'));var util=require(_0x163f('0x1'));var moment=require(_0x163f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x163f('0x3'));var db=require(_0x163f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x163f('0x5'));var config=require(_0x163f('0x6'));var jayson=require(_0x163f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20f552,_0x554429,_0x414774){return new BPromise(function(_0x1f9f34,_0x3c045a){return client[_0x163f('0x8')](_0x20f552,_0x414774)['then'](function(_0x37f927){logger['info'](_0x163f('0x9'),_0x554429,_0x163f('0xa'));logger[_0x163f('0xb')](_0x163f('0xc'),_0x554429,'request\x20sent',JSON[_0x163f('0xd')](_0x37f927));if(_0x37f927['error']){if(_0x37f927['error']['code']===0x1f4){logger[_0x163f('0xe')](_0x163f('0x9'),_0x554429,_0x37f927[_0x163f('0xe')][_0x163f('0xf')]);return _0x3c045a(_0x37f927['error']['message']);}logger[_0x163f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x554429,_0x37f927[_0x163f('0xe')]['message']);return _0x1f9f34(_0x37f927[_0x163f('0xe')][_0x163f('0xf')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x554429,'request\x20sent');_0x1f9f34(_0x37f927[_0x163f('0x10')][_0x163f('0xf')]);}})[_0x163f('0x11')](function(_0x5be949){logger['error'](_0x163f('0x9'),_0x554429,_0x5be949);_0x3c045a(_0x5be949);});});}exports[_0x163f('0x12')]=function(_0x5a3a9d){var _0x52a6f6=this;return new Promise(function(_0x13f68e,_0x38568b){return db[_0x163f('0x13')][_0x163f('0x14')](_0x5a3a9d['body'],{'raw':_0x5a3a9d[_0x163f('0x15')]?_0x5a3a9d[_0x163f('0x15')][_0x163f('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x515e1b){logger[_0x163f('0x17')](_0x163f('0x12'),_0x5a3a9d);logger[_0x163f('0xb')](_0x163f('0x12'),_0x5a3a9d,JSON[_0x163f('0xd')](_0x515e1b));_0x13f68e(_0x515e1b);})['catch'](function(_0x487dc5){logger[_0x163f('0xe')](_0x163f('0x12'),_0x487dc5['message'],_0x5a3a9d);_0x38568b(_0x52a6f6['error'](0x1f4,_0x487dc5[_0x163f('0xf')]));});});};
\ No newline at end of file