Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / campaign / campaign.rpc.js
index 0694116..112f5f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a9=['raw','where','attributes','include','model','map','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','options'];(function(_0x4c4d44,_0x199ab7){var _0x23af06=function(_0x1168c6){while(--_0x1168c6){_0x4c4d44['push'](_0x4c4d44['shift']());}};_0x23af06(++_0x199ab7);}(_0x18a9,0x15b));var _0x918a=function(_0x57d41c,_0x4a16e8){_0x57d41c=_0x57d41c-0x0;var _0x5d9d9e=_0x18a9[_0x57d41c];return _0x5d9d9e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Campaign,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Campaign,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});}exports[_0x918a('0x18')]=function(_0x51e467){var _0x199eb1=this;return new Promise(function(_0x22e347,_0x38ca45){return db[_0x918a('0x19')]['findAll']({'raw':_0x51e467[_0x918a('0x1a')]?_0x51e467[_0x918a('0x1a')][_0x918a('0x1b')]===undefined?!![]:![]:!![],'where':_0x51e467[_0x918a('0x1a')]?_0x51e467[_0x918a('0x1a')][_0x918a('0x1c')]||null:null,'attributes':_0x51e467[_0x918a('0x1a')]?_0x51e467['options'][_0x918a('0x1d')]||null:null,'limit':_0x51e467['options']?_0x51e467[_0x918a('0x1a')]['limit']||null:null,'include':_0x51e467['options']?_0x51e467['options'][_0x918a('0x1e')]?_['map'](_0x51e467[_0x918a('0x1a')][_0x918a('0x1e')],function(_0xadd3bc){return{'model':db[_0xadd3bc[_0x918a('0x1f')]],'as':_0xadd3bc['as'],'attributes':_0xadd3bc[_0x918a('0x1d')],'include':_0xadd3bc[_0x918a('0x1e')]?_[_0x918a('0x20')](_0xadd3bc[_0x918a('0x1e')],function(_0xfdad4a){return{'model':db[_0xfdad4a[_0x918a('0x1f')]],'as':_0xfdad4a['as'],'attributes':_0xfdad4a['attributes'],'include':_0xfdad4a[_0x918a('0x1e')]?_[_0x918a('0x20')](_0xfdad4a[_0x918a('0x1e')],function(_0x4a77c6){return{'model':db[_0x4a77c6[_0x918a('0x1f')]],'as':_0x4a77c6['as'],'attributes':_0x4a77c6[_0x918a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x918a('0xd')](function(_0x549cb4){logger[_0x918a('0xe')](_0x918a('0x18'),_0x51e467);logger[_0x918a('0x21')](_0x918a('0x18'),_0x51e467,JSON[_0x918a('0x12')](_0x549cb4));_0x22e347(_0x549cb4);})[_0x918a('0x17')](function(_0x51361c){logger['error']('GetCampaign',_0x51361c[_0x918a('0x15')],_0x51e467);_0x38ca45(_0x199eb1[_0x918a('0x13')](0x1f4,_0x51361c['message']));});});};
\ No newline at end of file
+var _0x4156=['request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','raw','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x580843,_0x1840bb){var _0x12a1e2=function(_0x5f02c5){while(--_0x5f02c5){_0x580843['push'](_0x580843['shift']());}};_0x12a1e2(++_0x1840bb);}(_0x4156,0xf1));var _0x6415=function(_0x359055,_0x20f62d){_0x359055=_0x359055-0x0;var _0xc50b4b=_0x4156[_0x359055];return _0xc50b4b;};'use strict';var _=require(_0x6415('0x0'));var util=require(_0x6415('0x1'));var moment=require(_0x6415('0x2'));var BPromise=require(_0x6415('0x3'));var rs=require(_0x6415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6415('0x5'))['db'];var utils=require(_0x6415('0x6'));var logger=require(_0x6415('0x7'))(_0x6415('0x8'));var config=require(_0x6415('0x9'));var jayson=require(_0x6415('0xa'));var client=jayson[_0x6415('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24cb0,_0x47ec13,_0x4045ec){return new BPromise(function(_0x266237,_0x5bc51b){return client[_0x6415('0xc')](_0x24cb0,_0x4045ec)[_0x6415('0xd')](function(_0x3383d2){logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'),JSON[_0x6415('0x10')](_0x3383d2));if(_0x3383d2[_0x6415('0x11')]){if(_0x3383d2[_0x6415('0x11')][_0x6415('0x12')]===0x1f4){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2['error']['message']);return _0x5bc51b(_0x3383d2[_0x6415('0x11')][_0x6415('0x14')]);}logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x3383d2[_0x6415('0x11')]['message']);return _0x266237(_0x3383d2['error'][_0x6415('0x14')]);}else{logger[_0x6415('0xe')]('Campaign,\x20%s,\x20%s',_0x47ec13,_0x6415('0xf'));_0x266237(_0x3383d2[_0x6415('0x15')]['message']);}})['catch'](function(_0x352a04){logger[_0x6415('0x11')](_0x6415('0x13'),_0x47ec13,_0x352a04);_0x5bc51b(_0x352a04);});});}exports[_0x6415('0x16')]=function(_0x2ef73b){var _0xa3d00a=this;return new Promise(function(_0x2c74c6,_0x468dc2){return db[_0x6415('0x17')]['findAll']({'raw':_0x2ef73b['options']?_0x2ef73b['options'][_0x6415('0x18')]===undefined?!![]:![]:!![],'where':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1a')]||null:null,'attributes':_0x2ef73b['options']?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1b')]||null:null,'limit':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b['options'][_0x6415('0x1c')]||null:null,'include':_0x2ef73b[_0x6415('0x19')]?_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x2ef73b[_0x6415('0x19')][_0x6415('0x1d')],function(_0x41c266){return{'model':db[_0x41c266[_0x6415('0x1f')]],'as':_0x41c266['as'],'attributes':_0x41c266['attributes'],'include':_0x41c266[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x41c266['include'],function(_0x15be31){return{'model':db[_0x15be31[_0x6415('0x1f')]],'as':_0x15be31['as'],'attributes':_0x15be31[_0x6415('0x1b')],'include':_0x15be31[_0x6415('0x1d')]?_[_0x6415('0x1e')](_0x15be31['include'],function(_0x30d857){return{'model':db[_0x30d857['model']],'as':_0x30d857['as'],'attributes':_0x30d857[_0x6415('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6415('0xd')](function(_0x25d459){logger['info']('GetCampaign',_0x2ef73b);logger['debug'](_0x6415('0x16'),_0x2ef73b,JSON[_0x6415('0x10')](_0x25d459));_0x2c74c6(_0x25d459);})['catch'](function(_0x5bf08d){logger[_0x6415('0x11')](_0x6415('0x16'),_0x5bf08d[_0x6415('0x14')],_0x2ef73b);_0x468dc2(_0xa3d00a[_0x6415('0x11')](0x1f4,_0x5bf08d[_0x6415('0x14')]));});});};
\ No newline at end of file