Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index 3b9f41a..2b51daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0416=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','raw','attributes','model','map','include','debug','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','register','request'];(function(_0x561f29,_0x465d8a){var _0x498c76=function(_0x556c30){while(--_0x556c30){_0x561f29['push'](_0x561f29['shift']());}};_0x498c76(++_0x465d8a);}(_0x0416,0x15d));var _0x6041=function(_0x452de8,_0x5a7fe7){_0x452de8=_0x452de8-0x0;var _0x3dd306=_0x0416[_0x452de8];return _0x3dd306;};'use strict';var _=require('lodash');var util=require(_0x6041('0x0'));var moment=require(_0x6041('0x1'));var BPromise=require(_0x6041('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6041('0x3'));var db=require(_0x6041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6041('0x5'));var config=require(_0x6041('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6041('0x7')]({'port':0x232a});config['redis']=_[_0x6041('0x8')](config['redis'],{'host':_0x6041('0x9'),'port':0x18eb});var socket=require(_0x6041('0xa'))(new Redis(config[_0x6041('0xb')]));require('./smsAccount.socket')[_0x6041('0xc')](socket);function respondWithRpcPromise(_0x14369b,_0x443d5c,_0x30007e){return new BPromise(function(_0x42817c,_0x1403a5){return client[_0x6041('0xd')](_0x14369b,_0x30007e)[_0x6041('0xe')](function(_0xcc7465){logger[_0x6041('0xf')](_0x6041('0x10'),_0x443d5c,_0x6041('0x11'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x443d5c,_0x6041('0x11'),JSON[_0x6041('0x12')](_0xcc7465));if(_0xcc7465[_0x6041('0x13')]){if(_0xcc7465[_0x6041('0x13')][_0x6041('0x14')]===0x1f4){logger[_0x6041('0x13')]('SmsAccount,\x20%s,\x20%s',_0x443d5c,_0xcc7465[_0x6041('0x13')]['message']);return _0x1403a5(_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);}logger[_0x6041('0x13')](_0x6041('0x10'),_0x443d5c,_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);return _0x42817c(_0xcc7465[_0x6041('0x13')][_0x6041('0x15')]);}else{logger[_0x6041('0xf')](_0x6041('0x10'),_0x443d5c,_0x6041('0x11'));_0x42817c(_0xcc7465[_0x6041('0x16')][_0x6041('0x15')]);}})[_0x6041('0x17')](function(_0x42ba7b){logger[_0x6041('0x13')](_0x6041('0x10'),_0x443d5c,_0x42ba7b);_0x1403a5(_0x42ba7b);});});}exports[_0x6041('0x18')]=function(_0x5a94d7){var _0x5d3d20=this;return new Promise(function(_0x394b97,_0x1e71ff){return db['SmsAccount'][_0x6041('0x19')]({'raw':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options'][_0x6041('0x1b')]===undefined?!![]:![]:!![],'where':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options']['where']||null:null,'attributes':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7['options'][_0x6041('0x1c')]||null:null,'include':_0x5a94d7[_0x6041('0x1a')]?_0x5a94d7[_0x6041('0x1a')]['include']?_['map'](_0x5a94d7['options']['include'],function(_0x1a061e){return{'model':db[_0x1a061e[_0x6041('0x1d')]],'as':_0x1a061e['as'],'attributes':_0x1a061e[_0x6041('0x1c')],'include':_0x1a061e['include']?_[_0x6041('0x1e')](_0x1a061e[_0x6041('0x1f')],function(_0x14a89d){return{'model':db[_0x14a89d[_0x6041('0x1d')]],'as':_0x14a89d['as'],'attributes':_0x14a89d['attributes'],'include':_0x14a89d['include']?_[_0x6041('0x1e')](_0x14a89d[_0x6041('0x1f')],function(_0x535bf3){return{'model':db[_0x535bf3['model']],'as':_0x535bf3['as'],'attributes':_0x535bf3[_0x6041('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6041('0xe')](function(_0x256b21){logger[_0x6041('0xf')](_0x6041('0x18'),_0x5a94d7);logger[_0x6041('0x20')]('ShowSmsAccount',_0x5a94d7,JSON[_0x6041('0x12')](_0x256b21));_0x394b97(_0x256b21);})[_0x6041('0x17')](function(_0x317c36){logger[_0x6041('0x13')]('ShowSmsAccount',_0x317c36[_0x6041('0x15')],_0x5a94d7);_0x1e71ff(_0x5d3d20[_0x6041('0x13')](0x1f4,_0x317c36[_0x6041('0x15')]));});});};
\ No newline at end of file
+var _0x2342=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','model','map','lodash','util'];(function(_0x598310,_0x30648f){var _0x1e383d=function(_0x19f592){while(--_0x19f592){_0x598310['push'](_0x598310['shift']());}};_0x1e383d(++_0x30648f);}(_0x2342,0xd0));var _0x2234=function(_0x44e4c9,_0x2ca1f4){_0x44e4c9=_0x44e4c9-0x0;var _0x507154=_0x2342[_0x44e4c9];return _0x507154;};'use strict';var _=require(_0x2234('0x0'));var util=require(_0x2234('0x1'));var moment=require(_0x2234('0x2'));var BPromise=require('bluebird');var rs=require(_0x2234('0x3'));var fs=require('fs');var Redis=require(_0x2234('0x4'));var db=require(_0x2234('0x5'))['db'];var utils=require(_0x2234('0x6'));var logger=require('../../config/logger')(_0x2234('0x7'));var config=require(_0x2234('0x8'));var jayson=require(_0x2234('0x9'));var client=jayson['client'][_0x2234('0xa')]({'port':0x232a});config['redis']=_[_0x2234('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2234('0xc'))(new Redis(config[_0x2234('0xd')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x260a95,_0x5d56af,_0x463342){return new BPromise(function(_0x2784c1,_0x1ff76a){return client[_0x2234('0xe')](_0x260a95,_0x463342)[_0x2234('0xf')](function(_0x266f42){logger[_0x2234('0x10')](_0x2234('0x11'),_0x5d56af,_0x2234('0x12'));logger[_0x2234('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5d56af,_0x2234('0x12'),JSON[_0x2234('0x14')](_0x266f42));if(_0x266f42[_0x2234('0x15')]){if(_0x266f42[_0x2234('0x15')][_0x2234('0x16')]===0x1f4){logger['error'](_0x2234('0x11'),_0x5d56af,_0x266f42[_0x2234('0x15')][_0x2234('0x17')]);return _0x1ff76a(_0x266f42[_0x2234('0x15')][_0x2234('0x17')]);}logger[_0x2234('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5d56af,_0x266f42[_0x2234('0x15')][_0x2234('0x17')]);return _0x2784c1(_0x266f42['error'][_0x2234('0x17')]);}else{logger[_0x2234('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5d56af,_0x2234('0x12'));_0x2784c1(_0x266f42[_0x2234('0x18')][_0x2234('0x17')]);}})[_0x2234('0x19')](function(_0x4386d3){logger['error'](_0x2234('0x11'),_0x5d56af,_0x4386d3);_0x1ff76a(_0x4386d3);});});}exports[_0x2234('0x1a')]=function(_0x2ed47c){var _0x2a3e76=this;return new Promise(function(_0x55dd12,_0x3de480){return db[_0x2234('0x1b')][_0x2234('0x1c')]({'raw':_0x2ed47c[_0x2234('0x1d')]?_0x2ed47c['options'][_0x2234('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ed47c[_0x2234('0x1d')]?_0x2ed47c[_0x2234('0x1d')]['where']||null:null,'attributes':_0x2ed47c[_0x2234('0x1d')]?_0x2ed47c[_0x2234('0x1d')][_0x2234('0x1f')]||null:null,'include':_0x2ed47c[_0x2234('0x1d')]?_0x2ed47c[_0x2234('0x1d')][_0x2234('0x20')]?_['map'](_0x2ed47c[_0x2234('0x1d')][_0x2234('0x20')],function(_0x5555b8){return{'model':db[_0x5555b8[_0x2234('0x21')]],'as':_0x5555b8['as'],'attributes':_0x5555b8[_0x2234('0x1f')],'include':_0x5555b8[_0x2234('0x20')]?_[_0x2234('0x22')](_0x5555b8[_0x2234('0x20')],function(_0x4a39fa){return{'model':db[_0x4a39fa[_0x2234('0x21')]],'as':_0x4a39fa['as'],'attributes':_0x4a39fa[_0x2234('0x1f')],'include':_0x4a39fa[_0x2234('0x20')]?_['map'](_0x4a39fa['include'],function(_0x1f376b){return{'model':db[_0x1f376b[_0x2234('0x21')]],'as':_0x1f376b['as'],'attributes':_0x1f376b[_0x2234('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2234('0xf')](function(_0xdb3ae7){logger[_0x2234('0x10')](_0x2234('0x1a'),_0x2ed47c);logger[_0x2234('0x13')](_0x2234('0x1a'),_0x2ed47c,JSON[_0x2234('0x14')](_0xdb3ae7));_0x55dd12(_0xdb3ae7);})[_0x2234('0x19')](function(_0x5be69d){logger[_0x2234('0x15')](_0x2234('0x1a'),_0x5be69d[_0x2234('0x17')],_0x2ed47c);_0x3de480(_0x2a3e76['error'](0x1f4,_0x5be69d['message']));});});};
\ No newline at end of file