Built motion from commit f541bb3b.|2.6.14
[motion2.git] / server / api / campaign / campaign.rpc.js
index fb49d35..710862b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b19=['message','result','catch','GetCampaign','findAll','options','raw','where','limit','include','map','model','attributes','then','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error'];(function(_0x268a14,_0x339230){var _0x11c674=function(_0x22725e){while(--_0x22725e){_0x268a14['push'](_0x268a14['shift']());}};_0x11c674(++_0x339230);}(_0x6b19,0xe8));var _0x96b1=function(_0x1b6d41,_0x50dedd){_0x1b6d41=_0x1b6d41-0x0;var _0x54bd5b=_0x6b19[_0x1b6d41];return _0x54bd5b;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});}exports[_0x96b1('0x13')]=function(_0x38478c){var _0x2b192a=this;return new Promise(function(_0x19972b,_0x212b31){return db['Campaign'][_0x96b1('0x14')]({'raw':_0x38478c['options']?_0x38478c[_0x96b1('0x15')][_0x96b1('0x16')]===undefined?!![]:![]:!![],'where':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x17')]||null:null,'attributes':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')]['attributes']||null:null,'limit':_0x38478c[_0x96b1('0x15')]?_0x38478c[_0x96b1('0x15')][_0x96b1('0x18')]||null:null,'include':_0x38478c[_0x96b1('0x15')]?_0x38478c['options'][_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x38478c[_0x96b1('0x15')]['include'],function(_0x2b4f8e){return{'model':db[_0x2b4f8e[_0x96b1('0x1b')]],'as':_0x2b4f8e['as'],'attributes':_0x2b4f8e[_0x96b1('0x1c')],'include':_0x2b4f8e[_0x96b1('0x19')]?_['map'](_0x2b4f8e[_0x96b1('0x19')],function(_0x548bae){return{'model':db[_0x548bae[_0x96b1('0x1b')]],'as':_0x548bae['as'],'attributes':_0x548bae['attributes'],'include':_0x548bae[_0x96b1('0x19')]?_[_0x96b1('0x1a')](_0x548bae['include'],function(_0x50dcbc){return{'model':db[_0x50dcbc['model']],'as':_0x50dcbc['as'],'attributes':_0x50dcbc[_0x96b1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96b1('0x1d')](function(_0x18e56a){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x38478c);logger['debug'](_0x96b1('0x13'),_0x38478c,JSON[_0x96b1('0x1e')](_0x18e56a));_0x19972b(_0x18e56a);})[_0x96b1('0x12')](function(_0x209ce8){logger['error'](_0x96b1('0x13'),_0x209ce8[_0x96b1('0x10')],_0x38478c);_0x212b31(_0x2b192a['error'](0x1f4,_0x209ce8['message']));});});};
\ No newline at end of file
+var _0xb201=['Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xc23311,_0x4b4373){var _0xfb9532=function(_0x25f56b){while(--_0x25f56b){_0xc23311['push'](_0xc23311['shift']());}};_0xfb9532(++_0x4b4373);}(_0xb201,0x1b1));var _0x1b20=function(_0x14ee16,_0x5443e9){_0x14ee16=_0x14ee16-0x0;var _0x5296a0=_0xb201[_0x14ee16];return _0x5296a0;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Campaign,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')]({'raw':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')][_0x1b20('0x18')]===undefined?!![]:![]:!![],'where':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')]['where']||null:null,'attributes':_0xff7c72[_0x1b20('0x17')]?_0xff7c72['options']['attributes']||null:null,'limit':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['limit']||null:null,'include':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['include']?_[_0x1b20('0x19')](_0xff7c72['options'][_0x1b20('0x1a')],function(_0x33e6ae){return{'model':db[_0x33e6ae[_0x1b20('0x1b')]],'as':_0x33e6ae['as'],'attributes':_0x33e6ae[_0x1b20('0x1c')],'include':_0x33e6ae[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x33e6ae['include'],function(_0x590b44){return{'model':db[_0x590b44[_0x1b20('0x1b')]],'as':_0x590b44['as'],'attributes':_0x590b44[_0x1b20('0x1c')],'include':_0x590b44[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x590b44[_0x1b20('0x1a')],function(_0x3a5cda){return{'model':db[_0x3a5cda[_0x1b20('0x1b')]],'as':_0x3a5cda['as'],'attributes':_0x3a5cda[_0x1b20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1b20('0xb')](function(_0xefa7f3){logger['info']('GetCampaign',_0xff7c72);logger[_0x1b20('0x1d')]('GetCampaign',_0xff7c72,JSON['stringify'](_0xefa7f3));_0x34517f(_0xefa7f3);})['catch'](function(_0x342a84){logger[_0x1b20('0xf')](_0x1b20('0x14'),_0x342a84[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e[_0x1b20('0xf')](0x1f4,_0x342a84[_0x1b20('0x12')]));});});};
\ No newline at end of file