Built motion from commit 44b1f254.|2.6.26
[motion2.git] / server / api / campaign / campaign.rpc.js
index 38e67b0..27dbc6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3299=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','findAll','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug'];(function(_0x3be7fe,_0x315935){var _0x3b3cfa=function(_0x1134ba){while(--_0x1134ba){_0x3be7fe['push'](_0x3be7fe['shift']());}};_0x3b3cfa(++_0x315935);}(_0x3299,0x1bc));var _0x9329=function(_0x33847b,_0x31e38b){_0x33847b=_0x33847b-0x0;var _0x352058=_0x3299[_0x33847b];return _0x352058;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Campaign'][_0x9329('0x1a')]({'raw':_0x1b5eed['options']?_0x1b5eed[_0x9329('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]||null:null,'attributes':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1d')]||null:null,'limit':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')]['limit']||null:null,'include':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x1b5eed[_0x9329('0x1b')]['include'],function(_0x22caa4){return{'model':db[_0x22caa4[_0x9329('0x20')]],'as':_0x22caa4['as'],'attributes':_0x22caa4['attributes'],'include':_0x22caa4[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x22caa4[_0x9329('0x1e')],function(_0x2da39d){return{'model':db[_0x2da39d['model']],'as':_0x2da39d['as'],'attributes':_0x2da39d['attributes'],'include':_0x2da39d[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x2da39d[_0x9329('0x1e')],function(_0x4f5fbf){return{'model':db[_0x4f5fbf[_0x9329('0x20')]],'as':_0x4f5fbf['as'],'attributes':_0x4f5fbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9329('0xe')](function(_0x192d0a){logger[_0x9329('0xf')]('GetCampaign',_0x1b5eed);logger['debug'](_0x9329('0x19'),_0x1b5eed,JSON['stringify'](_0x192d0a));_0x41db73(_0x192d0a);})[_0x9329('0x18')](function(_0x4a5d27){logger[_0x9329('0x13')]('GetCampaign',_0x4a5d27[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x4a5d27['message']));});});};
\ No newline at end of file
+var _0x37dc=['ioredis','../../config/utils','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Campaign','findAll','raw','options','limit','include','map','model','attributes','GetCampaign','lodash','util','moment','bluebird'];(function(_0x4dce97,_0x1b9719){var _0x417143=function(_0x1a5472){while(--_0x1a5472){_0x4dce97['push'](_0x4dce97['shift']());}};_0x417143(++_0x1b9719);}(_0x37dc,0x1e9));var _0xc37d=function(_0x4d046c,_0x20b5e1){_0x4d046c=_0x4d046c-0x0;var _0x1e2c79=_0x37dc[_0x4d046c];return _0x1e2c79;};'use strict';var _=require(_0xc37d('0x0'));var util=require(_0xc37d('0x1'));var moment=require(_0xc37d('0x2'));var BPromise=require(_0xc37d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc37d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc37d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc37d('0x6')][_0xc37d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11fe31,_0x368c3b,_0x1d6e8b){return new BPromise(function(_0x2076b3,_0x79252d){return client[_0xc37d('0x8')](_0x11fe31,_0x1d6e8b)[_0xc37d('0x9')](function(_0x5a0a61){logger[_0xc37d('0xa')](_0xc37d('0xb'),_0x368c3b,'request\x20sent');logger[_0xc37d('0xc')](_0xc37d('0xd'),_0x368c3b,'request\x20sent',JSON[_0xc37d('0xe')](_0x5a0a61));if(_0x5a0a61[_0xc37d('0xf')]){if(_0x5a0a61['error'][_0xc37d('0x10')]===0x1f4){logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x79252d(_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);}logger[_0xc37d('0xf')](_0xc37d('0xb'),_0x368c3b,_0x5a0a61[_0xc37d('0xf')][_0xc37d('0x11')]);return _0x2076b3(_0x5a0a61[_0xc37d('0xf')]['message']);}else{logger['info'](_0xc37d('0xb'),_0x368c3b,'request\x20sent');_0x2076b3(_0x5a0a61['result'][_0xc37d('0x11')]);}})[_0xc37d('0x12')](function(_0x5b204f){logger[_0xc37d('0xf')]('Campaign,\x20%s,\x20%s',_0x368c3b,_0x5b204f);_0x79252d(_0x5b204f);});});}exports['GetCampaign']=function(_0xcd23a5){var _0x1816f4=this;return new Promise(function(_0xfefa40,_0x36ee50){return db[_0xc37d('0x13')][_0xc37d('0x14')]({'raw':_0xcd23a5['options']?_0xcd23a5['options'][_0xc37d('0x15')]===undefined?!![]:![]:!![],'where':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')]['where']||null:null,'attributes':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')]['attributes']||null:null,'limit':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5['options'][_0xc37d('0x17')]||null:null,'include':_0xcd23a5[_0xc37d('0x16')]?_0xcd23a5[_0xc37d('0x16')][_0xc37d('0x18')]?_[_0xc37d('0x19')](_0xcd23a5[_0xc37d('0x16')][_0xc37d('0x18')],function(_0x1ab504){return{'model':db[_0x1ab504[_0xc37d('0x1a')]],'as':_0x1ab504['as'],'attributes':_0x1ab504['attributes'],'include':_0x1ab504[_0xc37d('0x18')]?_[_0xc37d('0x19')](_0x1ab504[_0xc37d('0x18')],function(_0x5c1dd7){return{'model':db[_0x5c1dd7[_0xc37d('0x1a')]],'as':_0x5c1dd7['as'],'attributes':_0x5c1dd7['attributes'],'include':_0x5c1dd7['include']?_[_0xc37d('0x19')](_0x5c1dd7[_0xc37d('0x18')],function(_0x459f13){return{'model':db[_0x459f13[_0xc37d('0x1a')]],'as':_0x459f13['as'],'attributes':_0x459f13[_0xc37d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a97ee){logger['info'](_0xc37d('0x1c'),_0xcd23a5);logger['debug'](_0xc37d('0x1c'),_0xcd23a5,JSON[_0xc37d('0xe')](_0x1a97ee));_0xfefa40(_0x1a97ee);})[_0xc37d('0x12')](function(_0x26be2a){logger[_0xc37d('0xf')](_0xc37d('0x1c'),_0x26be2a[_0xc37d('0x11')],_0xcd23a5);_0x36ee50(_0x1816f4[_0xc37d('0xf')](0x1f4,_0x26be2a['message']));});});};
\ No newline at end of file