Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / campaign / campaign.rpc.js
1 const a44_0x1bb4=['findAll','where','../../config/logger','lodash','include','error','map','debug','limit','GetCampaign','attributes','options','model','raw','message','then','stringify'];(function(_0x5171e9,_0x1bb4d0){const _0x5d112e=function(_0x5e089e){while(--_0x5e089e){_0x5171e9['push'](_0x5171e9['shift']());}};_0x5d112e(++_0x1bb4d0);}(a44_0x1bb4,0xa0));const a44_0x5d11=function(_0x5171e9,_0x1bb4d0){_0x5171e9=_0x5171e9-0x0;let _0x5d112e=a44_0x1bb4[_0x5171e9];return _0x5d112e;};const _0x11e3de=a44_0x5d11;'use strict';const _=require(_0x11e3de('0xd')),db=require('../../mysqldb')['db'],logger=require(_0x11e3de('0xc'))('rpc');exports[_0x11e3de('0x2')]=function(_0x5e089e){const _0x29860d=this;return new Promise(function(_0x461c55,_0x43b8c9){const _0x479904=a44_0x5d11;return db['Campaign'][_0x479904('0xa')]({'raw':_0x5e089e[_0x479904('0x4')]?_0x5e089e[_0x479904('0x4')][_0x479904('0x6')]===undefined?!![]:![]:!![],'where':_0x5e089e['options']?_0x5e089e[_0x479904('0x4')][_0x479904('0xb')]||null:null,'attributes':_0x5e089e[_0x479904('0x4')]?_0x5e089e[_0x479904('0x4')][_0x479904('0x3')]||null:null,'limit':_0x5e089e['options']?_0x5e089e[_0x479904('0x4')][_0x479904('0x1')]||null:null,'include':_0x5e089e[_0x479904('0x4')]?_0x5e089e[_0x479904('0x4')][_0x479904('0xe')]?_['map'](_0x5e089e['options'][_0x479904('0xe')],function(_0x18740c){const _0x1f5d61=_0x479904;return{'model':db[_0x18740c[_0x1f5d61('0x5')]],'as':_0x18740c['as'],'attributes':_0x18740c['attributes'],'include':_0x18740c[_0x1f5d61('0xe')]?_[_0x1f5d61('0x10')](_0x18740c[_0x1f5d61('0xe')],function(_0x1877c5){const _0x558e82=_0x1f5d61;return{'model':db[_0x1877c5[_0x558e82('0x5')]],'as':_0x1877c5['as'],'attributes':_0x1877c5[_0x558e82('0x3')],'include':_0x1877c5[_0x558e82('0xe')]?_['map'](_0x1877c5[_0x558e82('0xe')],function(_0x7bdcf5){const _0x3d5b5b=_0x558e82;return{'model':db[_0x7bdcf5['model']],'as':_0x7bdcf5['as'],'attributes':_0x7bdcf5[_0x3d5b5b('0x3')]};}):[]};}):[]};}):[]:[]})[_0x479904('0x8')](function(_0x51ac5e){const _0x3488ff=_0x479904;logger['info'](_0x3488ff('0x2'),_0x5e089e),logger[_0x3488ff('0x0')]('GetCampaign',_0x5e089e,JSON[_0x3488ff('0x9')](_0x51ac5e)),_0x461c55(_0x51ac5e);})['catch'](function(_0x3e3f99){const _0x569dec=_0x479904;logger[_0x569dec('0xf')](_0x569dec('0x2'),_0x3e3f99['message'],_0x5e089e),_0x43b8c9(_0x29860d[_0x569dec('0xf')](0x1f4,_0x3e3f99[_0x569dec('0x7')]));});});};