Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / campaign / campaign.rpc.js
index 20de104..df76ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7daf=['limit','map','include','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetCampaign','Campaign','findAll','options','raw','where','attributes'];(function(_0x46bfab,_0x29834f){var _0x298002=function(_0x3c2f10){while(--_0x3c2f10){_0x46bfab['push'](_0x46bfab['shift']());}};_0x298002(++_0x29834f);}(_0x7daf,0xaa));var _0xf7da=function(_0x4aab29,_0xe600b8){_0x4aab29=_0x4aab29-0x0;var _0x521231=_0x7daf[_0x4aab29];return _0x521231;};'use strict';var _=require('lodash');var util=require(_0xf7da('0x0'));var moment=require('moment');var BPromise=require(_0xf7da('0x1'));var rs=require(_0xf7da('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7da('0x3'))['db'];var utils=require(_0xf7da('0x4'));var logger=require(_0xf7da('0x5'))(_0xf7da('0x6'));var config=require(_0xf7da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf7da('0x8')][_0xf7da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b35ec,_0x110cad,_0x2c70ad){return new BPromise(function(_0x468ca3,_0x53d71f){return client[_0xf7da('0xa')](_0x1b35ec,_0x2c70ad)[_0xf7da('0xb')](function(_0x326ff5){logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));logger[_0xf7da('0xf')](_0xf7da('0x10'),_0x110cad,_0xf7da('0xe'),JSON[_0xf7da('0x11')](_0x326ff5));if(_0x326ff5['error']){if(_0x326ff5['error'][_0xf7da('0x12')]===0x1f4){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);return _0x53d71f(_0x326ff5[_0xf7da('0x13')]['message']);}logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x326ff5['error'][_0xf7da('0x14')]);return _0x468ca3(_0x326ff5[_0xf7da('0x13')][_0xf7da('0x14')]);}else{logger[_0xf7da('0xc')](_0xf7da('0xd'),_0x110cad,_0xf7da('0xe'));_0x468ca3(_0x326ff5['result']['message']);}})['catch'](function(_0x39d9c0){logger[_0xf7da('0x13')](_0xf7da('0xd'),_0x110cad,_0x39d9c0);_0x53d71f(_0x39d9c0);});});}exports[_0xf7da('0x15')]=function(_0x336fca){var _0x1f3d53=this;return new Promise(function(_0xb75a2c,_0x13cd4a){return db[_0xf7da('0x16')][_0xf7da('0x17')]({'raw':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x19')]===undefined?!![]:![]:!![],'where':_0x336fca[_0xf7da('0x18')]?_0x336fca['options'][_0xf7da('0x1a')]||null:null,'attributes':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1b')]||null:null,'limit':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')][_0xf7da('0x1c')]||null:null,'include':_0x336fca[_0xf7da('0x18')]?_0x336fca[_0xf7da('0x18')]['include']?_[_0xf7da('0x1d')](_0x336fca[_0xf7da('0x18')][_0xf7da('0x1e')],function(_0x4b627e){return{'model':db[_0x4b627e[_0xf7da('0x1f')]],'as':_0x4b627e['as'],'attributes':_0x4b627e[_0xf7da('0x1b')],'include':_0x4b627e[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x4b627e[_0xf7da('0x1e')],function(_0x9d2da){return{'model':db[_0x9d2da['model']],'as':_0x9d2da['as'],'attributes':_0x9d2da[_0xf7da('0x1b')],'include':_0x9d2da[_0xf7da('0x1e')]?_[_0xf7da('0x1d')](_0x9d2da['include'],function(_0x13ace4){return{'model':db[_0x13ace4[_0xf7da('0x1f')]],'as':_0x13ace4['as'],'attributes':_0x13ace4[_0xf7da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf7da('0xb')](function(_0x13dc9f){logger['info'](_0xf7da('0x15'),_0x336fca);logger['debug'](_0xf7da('0x15'),_0x336fca,JSON[_0xf7da('0x11')](_0x13dc9f));_0xb75a2c(_0x13dc9f);})[_0xf7da('0x20')](function(_0x23a27e){logger['error'](_0xf7da('0x15'),_0x23a27e[_0xf7da('0x14')],_0x336fca);_0x13cd4a(_0x1f3d53[_0xf7da('0x13')](0x1f4,_0x23a27e[_0xf7da('0x14')]));});});};
\ No newline at end of file
+var _0x9bde=['model','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Campaign,\x20%s,\x20%s','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','map','include'];(function(_0x28e71c,_0x45c92f){var _0x115428=function(_0x2b07e9){while(--_0x2b07e9){_0x28e71c['push'](_0x28e71c['shift']());}};_0x115428(++_0x45c92f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2f4e56,_0x30f768){_0x2f4e56=_0x2f4e56-0x0;var _0x32b0ca=_0x9bde[_0x2f4e56];return _0x32b0ca;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('Campaign,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('Campaign,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}exports[_0xe9bd('0x16')]=function(_0x3bae08){var _0x34ba2b=this;return new Promise(function(_0x330733,_0x5cf674){return db[_0xe9bd('0x17')]['findAll']({'raw':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08['options'][_0xe9bd('0x19')]===undefined?!![]:![]:!![],'where':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1a')]||null:null,'attributes':_0x3bae08[_0xe9bd('0x18')]?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1b')]||null:null,'limit':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1c')]||null:null,'include':_0x3bae08['options']?_0x3bae08[_0xe9bd('0x18')]['include']?_[_0xe9bd('0x1d')](_0x3bae08[_0xe9bd('0x18')][_0xe9bd('0x1e')],function(_0xf02209){return{'model':db[_0xf02209['model']],'as':_0xf02209['as'],'attributes':_0xf02209[_0xe9bd('0x1b')],'include':_0xf02209[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0xf02209[_0xe9bd('0x1e')],function(_0x2641be){return{'model':db[_0x2641be[_0xe9bd('0x1f')]],'as':_0x2641be['as'],'attributes':_0x2641be[_0xe9bd('0x1b')],'include':_0x2641be[_0xe9bd('0x1e')]?_[_0xe9bd('0x1d')](_0x2641be['include'],function(_0x3c211a){return{'model':db[_0x3c211a[_0xe9bd('0x1f')]],'as':_0x3c211a['as'],'attributes':_0x3c211a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9bd('0xb')](function(_0xc25248){logger[_0xe9bd('0xc')](_0xe9bd('0x16'),_0x3bae08);logger[_0xe9bd('0xd')](_0xe9bd('0x16'),_0x3bae08,JSON['stringify'](_0xc25248));_0x330733(_0xc25248);})['catch'](function(_0x1de54c){logger['error'](_0xe9bd('0x16'),_0x1de54c[_0xe9bd('0x12')],_0x3bae08);_0x5cf674(_0x34ba2b[_0xe9bd('0x10')](0x1f4,_0x1de54c[_0xe9bd('0x12')]));});});};
\ No newline at end of file