Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / campaign / campaign.rpc.js
index 25e5e83..acc81d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf1a=['../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xbf1a,0x7c));var _0xabf1=function(_0x43a17f,_0x555897){_0x43a17f=_0x43a17f-0x0;var _0x60edac=_0xbf1a[_0x43a17f];return _0x60edac;};'use strict';var _=require(_0xabf1('0x0'));var util=require(_0xabf1('0x1'));var moment=require(_0xabf1('0x2'));var BPromise=require(_0xabf1('0x3'));var rs=require(_0xabf1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabf1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabf1('0x6'))(_0xabf1('0x7'));var config=require(_0xabf1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xabf1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5b53,_0x3bdf07,_0x1cc1f6){return new BPromise(function(_0x1f48f5,_0x3eb992){return client[_0xabf1('0xa')](_0x4f5b53,_0x1cc1f6)[_0xabf1('0xb')](function(_0x59a7a2){logger[_0xabf1('0xc')](_0xabf1('0xd'),_0x3bdf07,_0xabf1('0xe'));logger[_0xabf1('0xf')](_0xabf1('0x10'),_0x3bdf07,_0xabf1('0xe'),JSON['stringify'](_0x59a7a2));if(_0x59a7a2[_0xabf1('0x11')]){if(_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x12')]===0x1f4){logger[_0xabf1('0x11')](_0xabf1('0xd'),_0x3bdf07,_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);return _0x3eb992(_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);}logger[_0xabf1('0x11')]('Campaign,\x20%s,\x20%s',_0x3bdf07,_0x59a7a2[_0xabf1('0x11')][_0xabf1('0x13')]);return _0x1f48f5(_0x59a7a2[_0xabf1('0x11')]['message']);}else{logger[_0xabf1('0xc')](_0xabf1('0xd'),_0x3bdf07,_0xabf1('0xe'));_0x1f48f5(_0x59a7a2[_0xabf1('0x14')]['message']);}})[_0xabf1('0x15')](function(_0x4b138d){logger[_0xabf1('0x11')](_0xabf1('0xd'),_0x3bdf07,_0x4b138d);_0x3eb992(_0x4b138d);});});}exports[_0xabf1('0x16')]=function(_0x363c21){var _0x26e9f8=this;return new Promise(function(_0xd5dc16,_0x3cfc35){return db[_0xabf1('0x17')][_0xabf1('0x18')]({'raw':_0x363c21[_0xabf1('0x19')]?_0x363c21[_0xabf1('0x19')][_0xabf1('0x1a')]===undefined?!![]:![]:!![],'where':_0x363c21[_0xabf1('0x19')]?_0x363c21[_0xabf1('0x19')][_0xabf1('0x1b')]||null:null,'attributes':_0x363c21['options']?_0x363c21['options'][_0xabf1('0x1c')]||null:null,'limit':_0x363c21[_0xabf1('0x19')]?_0x363c21[_0xabf1('0x19')]['limit']||null:null,'include':_0x363c21[_0xabf1('0x19')]?_0x363c21[_0xabf1('0x19')][_0xabf1('0x1d')]?_['map'](_0x363c21[_0xabf1('0x19')]['include'],function(_0x30fac8){return{'model':db[_0x30fac8['model']],'as':_0x30fac8['as'],'attributes':_0x30fac8['attributes'],'include':_0x30fac8['include']?_[_0xabf1('0x1e')](_0x30fac8[_0xabf1('0x1d')],function(_0x4939cd){return{'model':db[_0x4939cd[_0xabf1('0x1f')]],'as':_0x4939cd['as'],'attributes':_0x4939cd[_0xabf1('0x1c')],'include':_0x4939cd['include']?_['map'](_0x4939cd[_0xabf1('0x1d')],function(_0x175678){return{'model':db[_0x175678[_0xabf1('0x1f')]],'as':_0x175678['as'],'attributes':_0x175678[_0xabf1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xabf1('0xb')](function(_0x555593){logger[_0xabf1('0xc')]('GetCampaign',_0x363c21);logger[_0xabf1('0xf')]('GetCampaign',_0x363c21,JSON[_0xabf1('0x20')](_0x555593));_0xd5dc16(_0x555593);})['catch'](function(_0x45e64f){logger[_0xabf1('0x11')](_0xabf1('0x16'),_0x45e64f[_0xabf1('0x13')],_0x363c21);_0x3cfc35(_0x26e9f8['error'](0x1f4,_0x45e64f[_0xabf1('0x13')]));});});};
\ No newline at end of file
+var _0x8e0d=['then','Campaign,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','GetCampaign','Campaign','options','attributes','limit','include','map','model','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x1c4df9,_0x506052){var _0x553894=function(_0x373fe2){while(--_0x373fe2){_0x1c4df9['push'](_0x1c4df9['shift']());}};_0x553894(++_0x506052);}(_0x8e0d,0x82));var _0xd8e0=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x8e0d[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8e0('0x1'));var rs=require(_0xd8e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))(_0xd8e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8e0('0x7')][_0xd8e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d42b,_0x1e4616,_0x5e9735){return new BPromise(function(_0xd0c45c,_0x144a8a){return client[_0xd8e0('0x9')](_0x42d42b,_0x5e9735)[_0xd8e0('0xa')](function(_0x127a32){logger['info'](_0xd8e0('0xb'),_0x1e4616,'request\x20sent');logger[_0xd8e0('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1e4616,'request\x20sent',JSON[_0xd8e0('0xd')](_0x127a32));if(_0x127a32[_0xd8e0('0xe')]){if(_0x127a32[_0xd8e0('0xe')]['code']===0x1f4){logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0x144a8a(_0x127a32['error']['message']);}logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0xd0c45c(_0x127a32[_0xd8e0('0xe')][_0xd8e0('0xf')]);}else{logger[_0xd8e0('0x10')](_0xd8e0('0xb'),_0x1e4616,_0xd8e0('0x11'));_0xd0c45c(_0x127a32[_0xd8e0('0x12')][_0xd8e0('0xf')]);}})[_0xd8e0('0x13')](function(_0x488ed9){logger[_0xd8e0('0xe')](_0xd8e0('0xb'),_0x1e4616,_0x488ed9);_0x144a8a(_0x488ed9);});});}exports[_0xd8e0('0x14')]=function(_0x42586f){var _0x3b28bc=this;return new Promise(function(_0x2bf195,_0x2c4eaf){return db[_0xd8e0('0x15')]['findAll']({'raw':_0x42586f[_0xd8e0('0x16')]?_0x42586f[_0xd8e0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x42586f[_0xd8e0('0x16')]?_0x42586f['options']['where']||null:null,'attributes':_0x42586f['options']?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x17')]||null:null,'limit':_0x42586f['options']?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x18')]||null:null,'include':_0x42586f[_0xd8e0('0x16')]?_0x42586f[_0xd8e0('0x16')][_0xd8e0('0x19')]?_[_0xd8e0('0x1a')](_0x42586f['options'][_0xd8e0('0x19')],function(_0x340ae1){return{'model':db[_0x340ae1['model']],'as':_0x340ae1['as'],'attributes':_0x340ae1['attributes'],'include':_0x340ae1['include']?_[_0xd8e0('0x1a')](_0x340ae1[_0xd8e0('0x19')],function(_0x2c1257){return{'model':db[_0x2c1257[_0xd8e0('0x1b')]],'as':_0x2c1257['as'],'attributes':_0x2c1257[_0xd8e0('0x17')],'include':_0x2c1257['include']?_['map'](_0x2c1257[_0xd8e0('0x19')],function(_0x469b52){return{'model':db[_0x469b52[_0xd8e0('0x1b')]],'as':_0x469b52['as'],'attributes':_0x469b52[_0xd8e0('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15bd32){logger[_0xd8e0('0x10')](_0xd8e0('0x14'),_0x42586f);logger[_0xd8e0('0xc')]('GetCampaign',_0x42586f,JSON[_0xd8e0('0xd')](_0x15bd32));_0x2bf195(_0x15bd32);})[_0xd8e0('0x13')](function(_0x1a9364){logger[_0xd8e0('0xe')](_0xd8e0('0x14'),_0x1a9364[_0xd8e0('0xf')],_0x42586f);_0x2c4eaf(_0x3b28bc[_0xd8e0('0xe')](0x1f4,_0x1a9364['message']));});});};
\ No newline at end of file