Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / api / campaign / campaign.rpc.js
index 21822eb..e62e931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x490f=['bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','then','GetCampaign','stringify','util','moment'];(function(_0x2f7abe,_0x5465ee){var _0x50eaff=function(_0x351f1c){while(--_0x351f1c){_0x2f7abe['push'](_0x2f7abe['shift']());}};_0x50eaff(++_0x5465ee);}(_0x490f,0x1de));var _0xf490=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x490f[_0x5eb22e];return _0x27fed5;};'use strict';var _=require('lodash');var util=require(_0xf490('0x0'));var moment=require(_0xf490('0x1'));var BPromise=require(_0xf490('0x2'));var rs=require(_0xf490('0x3'));var fs=require('fs');var Redis=require(_0xf490('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf490('0x5'))(_0xf490('0x6'));var config=require('../../config/environment');var jayson=require(_0xf490('0x7'));var client=jayson['client'][_0xf490('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345fde,_0x345895,_0x45e73e){return new BPromise(function(_0x4746d5,_0x3c5db7){return client[_0xf490('0x9')](_0x345fde,_0x45e73e)['then'](function(_0x1ca9e1){logger[_0xf490('0xa')](_0xf490('0xb'),_0x345895,'request\x20sent');logger[_0xf490('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x345895,_0xf490('0xd'),JSON['stringify'](_0x1ca9e1));if(_0x1ca9e1['error']){if(_0x1ca9e1[_0xf490('0xe')][_0xf490('0xf')]===0x1f4){logger['error'](_0xf490('0xb'),_0x345895,_0x1ca9e1[_0xf490('0xe')]['message']);return _0x3c5db7(_0x1ca9e1[_0xf490('0xe')][_0xf490('0x10')]);}logger[_0xf490('0xe')](_0xf490('0xb'),_0x345895,_0x1ca9e1[_0xf490('0xe')]['message']);return _0x4746d5(_0x1ca9e1[_0xf490('0xe')]['message']);}else{logger[_0xf490('0xa')](_0xf490('0xb'),_0x345895,_0xf490('0xd'));_0x4746d5(_0x1ca9e1[_0xf490('0x11')][_0xf490('0x10')]);}})[_0xf490('0x12')](function(_0x3d7fdf){logger[_0xf490('0xe')](_0xf490('0xb'),_0x345895,_0x3d7fdf);_0x3c5db7(_0x3d7fdf);});});}exports['GetCampaign']=function(_0x5cc253){var _0x4d1262=this;return new Promise(function(_0x19b60d,_0x39a472){return db[_0xf490('0x13')][_0xf490('0x14')]({'raw':_0x5cc253['options']?_0x5cc253[_0xf490('0x15')][_0xf490('0x16')]===undefined?!![]:![]:!![],'where':_0x5cc253['options']?_0x5cc253[_0xf490('0x15')][_0xf490('0x17')]||null:null,'attributes':_0x5cc253[_0xf490('0x15')]?_0x5cc253['options'][_0xf490('0x18')]||null:null,'limit':_0x5cc253[_0xf490('0x15')]?_0x5cc253[_0xf490('0x15')][_0xf490('0x19')]||null:null,'include':_0x5cc253[_0xf490('0x15')]?_0x5cc253[_0xf490('0x15')]['include']?_['map'](_0x5cc253[_0xf490('0x15')][_0xf490('0x1a')],function(_0x2d75b4){return{'model':db[_0x2d75b4[_0xf490('0x1b')]],'as':_0x2d75b4['as'],'attributes':_0x2d75b4[_0xf490('0x18')],'include':_0x2d75b4[_0xf490('0x1a')]?_['map'](_0x2d75b4[_0xf490('0x1a')],function(_0x243481){return{'model':db[_0x243481[_0xf490('0x1b')]],'as':_0x243481['as'],'attributes':_0x243481['attributes'],'include':_0x243481[_0xf490('0x1a')]?_[_0xf490('0x1c')](_0x243481['include'],function(_0x2ed47b){return{'model':db[_0x2ed47b[_0xf490('0x1b')]],'as':_0x2ed47b['as'],'attributes':_0x2ed47b['attributes']};}):[]};}):[]};}):[]:[]})[_0xf490('0x1d')](function(_0x1ed917){logger[_0xf490('0xa')](_0xf490('0x1e'),_0x5cc253);logger[_0xf490('0xc')](_0xf490('0x1e'),_0x5cc253,JSON[_0xf490('0x1f')](_0x1ed917));_0x19b60d(_0x1ed917);})['catch'](function(_0x1027e2){logger[_0xf490('0xe')](_0xf490('0x1e'),_0x1027e2['message'],_0x5cc253);_0x39a472(_0x4d1262[_0xf490('0xe')](0x1f4,_0x1027e2['message']));});});};
\ No newline at end of file
+var _0xf8e0=['map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','where','attributes','include'];(function(_0x3144b3,_0x45f961){var _0x2517a9=function(_0x15af07){while(--_0x15af07){_0x3144b3['push'](_0x3144b3['shift']());}};_0x2517a9(++_0x45f961);}(_0xf8e0,0x1ef));var _0x0f8e=function(_0x5e645a,_0x14e641){_0x5e645a=_0x5e645a-0x0;var _0x7e069b=_0xf8e0[_0x5e645a];return _0x7e069b;};'use strict';var _=require('lodash');var util=require(_0x0f8e('0x0'));var moment=require(_0x0f8e('0x1'));var BPromise=require(_0x0f8e('0x2'));var rs=require(_0x0f8e('0x3'));var fs=require('fs');var Redis=require(_0x0f8e('0x4'));var db=require(_0x0f8e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f8e('0x6'))(_0x0f8e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f8e('0x8')][_0x0f8e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5289d2,_0x37d262,_0x4e6de2){return new BPromise(function(_0x55adb7,_0x2e3a3c){return client['request'](_0x5289d2,_0x4e6de2)[_0x0f8e('0xa')](function(_0x4f6cd1){logger[_0x0f8e('0xb')](_0x0f8e('0xc'),_0x37d262,_0x0f8e('0xd'));logger[_0x0f8e('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x37d262,_0x0f8e('0xd'),JSON[_0x0f8e('0xf')](_0x4f6cd1));if(_0x4f6cd1['error']){if(_0x4f6cd1[_0x0f8e('0x10')][_0x0f8e('0x11')]===0x1f4){logger[_0x0f8e('0x10')](_0x0f8e('0xc'),_0x37d262,_0x4f6cd1[_0x0f8e('0x10')][_0x0f8e('0x12')]);return _0x2e3a3c(_0x4f6cd1[_0x0f8e('0x10')][_0x0f8e('0x12')]);}logger[_0x0f8e('0x10')](_0x0f8e('0xc'),_0x37d262,_0x4f6cd1[_0x0f8e('0x10')][_0x0f8e('0x12')]);return _0x55adb7(_0x4f6cd1[_0x0f8e('0x10')][_0x0f8e('0x12')]);}else{logger[_0x0f8e('0xb')](_0x0f8e('0xc'),_0x37d262,'request\x20sent');_0x55adb7(_0x4f6cd1['result']['message']);}})[_0x0f8e('0x13')](function(_0x12c195){logger[_0x0f8e('0x10')](_0x0f8e('0xc'),_0x37d262,_0x12c195);_0x2e3a3c(_0x12c195);});});}exports[_0x0f8e('0x14')]=function(_0x1c41ab){var _0x27db98=this;return new Promise(function(_0x1a12a1,_0xc0e658){return db[_0x0f8e('0x15')][_0x0f8e('0x16')]({'raw':_0x1c41ab[_0x0f8e('0x17')]?_0x1c41ab[_0x0f8e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1c41ab[_0x0f8e('0x17')]?_0x1c41ab[_0x0f8e('0x17')][_0x0f8e('0x18')]||null:null,'attributes':_0x1c41ab[_0x0f8e('0x17')]?_0x1c41ab[_0x0f8e('0x17')][_0x0f8e('0x19')]||null:null,'limit':_0x1c41ab['options']?_0x1c41ab[_0x0f8e('0x17')]['limit']||null:null,'include':_0x1c41ab[_0x0f8e('0x17')]?_0x1c41ab[_0x0f8e('0x17')][_0x0f8e('0x1a')]?_['map'](_0x1c41ab[_0x0f8e('0x17')][_0x0f8e('0x1a')],function(_0x16604c){return{'model':db[_0x16604c['model']],'as':_0x16604c['as'],'attributes':_0x16604c[_0x0f8e('0x19')],'include':_0x16604c[_0x0f8e('0x1a')]?_[_0x0f8e('0x1b')](_0x16604c[_0x0f8e('0x1a')],function(_0x198924){return{'model':db[_0x198924[_0x0f8e('0x1c')]],'as':_0x198924['as'],'attributes':_0x198924[_0x0f8e('0x19')],'include':_0x198924[_0x0f8e('0x1a')]?_['map'](_0x198924[_0x0f8e('0x1a')],function(_0x2a366d){return{'model':db[_0x2a366d[_0x0f8e('0x1c')]],'as':_0x2a366d['as'],'attributes':_0x2a366d[_0x0f8e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0f8e('0xa')](function(_0x11ed9e){logger[_0x0f8e('0xb')](_0x0f8e('0x14'),_0x1c41ab);logger[_0x0f8e('0xe')](_0x0f8e('0x14'),_0x1c41ab,JSON[_0x0f8e('0xf')](_0x11ed9e));_0x1a12a1(_0x11ed9e);})[_0x0f8e('0x13')](function(_0x568bb6){logger[_0x0f8e('0x10')](_0x0f8e('0x14'),_0x568bb6[_0x0f8e('0x12')],_0x1c41ab);_0xc0e658(_0x27db98[_0x0f8e('0x10')](0x1f4,_0x568bb6[_0x0f8e('0x12')]));});});};
\ No newline at end of file