Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index 13c56ed..0d79b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc54=['info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','options','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x274222,_0x20bb9a){var _0x34a71f=function(_0xd185ee){while(--_0xd185ee){_0x274222['push'](_0x274222['shift']());}};_0x34a71f(++_0x20bb9a);}(_0xbc54,0x79));var _0x4bc5=function(_0x3d8c9b,_0x49e6ea){_0x3d8c9b=_0x3d8c9b-0x0;var _0xc31fc0=_0xbc54[_0x3d8c9b];return _0xc31fc0;};'use strict';var _=require(_0x4bc5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4bc5('0x1'));var rs=require(_0x4bc5('0x2'));var fs=require('fs');var Redis=require(_0x4bc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4bc5('0x4'))(_0x4bc5('0x5'));var config=require('../../config/environment');var jayson=require(_0x4bc5('0x6'));var client=jayson[_0x4bc5('0x7')][_0x4bc5('0x8')]({'port':0x232a});config['redis']=_[_0x4bc5('0x9')](config[_0x4bc5('0xa')],{'host':_0x4bc5('0xb'),'port':0x18eb});var socket=require(_0x4bc5('0xc'))(new Redis(config[_0x4bc5('0xa')]));require(_0x4bc5('0xd'))[_0x4bc5('0xe')](socket);function respondWithRpcPromise(_0x490448,_0x25aa91,_0x1bed49){return new BPromise(function(_0x493106,_0x3c5d2a){return client['request'](_0x490448,_0x1bed49)['then'](function(_0x8d25a7){logger[_0x4bc5('0xf')]('SmsAccount,\x20%s,\x20%s',_0x25aa91,_0x4bc5('0x10'));logger[_0x4bc5('0x11')](_0x4bc5('0x12'),_0x25aa91,_0x4bc5('0x10'),JSON[_0x4bc5('0x13')](_0x8d25a7));if(_0x8d25a7[_0x4bc5('0x14')]){if(_0x8d25a7[_0x4bc5('0x14')][_0x4bc5('0x15')]===0x1f4){logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x8d25a7[_0x4bc5('0x14')]['message']);return _0x3c5d2a(_0x8d25a7[_0x4bc5('0x14')][_0x4bc5('0x17')]);}logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x8d25a7[_0x4bc5('0x14')]['message']);return _0x493106(_0x8d25a7['error'][_0x4bc5('0x17')]);}else{logger[_0x4bc5('0xf')](_0x4bc5('0x16'),_0x25aa91,_0x4bc5('0x10'));_0x493106(_0x8d25a7[_0x4bc5('0x18')][_0x4bc5('0x17')]);}})[_0x4bc5('0x19')](function(_0x18fc3d){logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x18fc3d);_0x3c5d2a(_0x18fc3d);});});}exports[_0x4bc5('0x1a')]=function(_0x44516a){var _0x3194e8=this;return new Promise(function(_0x411454,_0x3c6b7d){return db[_0x4bc5('0x1b')]['find']({'raw':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1d')]||null:null,'attributes':_0x44516a['options']?_0x44516a['options'][_0x4bc5('0x1e')]||null:null,'include':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1f')]?_[_0x4bc5('0x20')](_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1f')],function(_0x210bbf){return{'model':db[_0x210bbf[_0x4bc5('0x21')]],'as':_0x210bbf['as'],'attributes':_0x210bbf['attributes'],'include':_0x210bbf[_0x4bc5('0x1f')]?_['map'](_0x210bbf[_0x4bc5('0x1f')],function(_0x9c4c6d){return{'model':db[_0x9c4c6d[_0x4bc5('0x21')]],'as':_0x9c4c6d['as'],'attributes':_0x9c4c6d[_0x4bc5('0x1e')],'include':_0x9c4c6d['include']?_['map'](_0x9c4c6d[_0x4bc5('0x1f')],function(_0x1398a6){return{'model':db[_0x1398a6['model']],'as':_0x1398a6['as'],'attributes':_0x1398a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5436f7){logger[_0x4bc5('0xf')](_0x4bc5('0x1a'),_0x44516a);logger[_0x4bc5('0x11')](_0x4bc5('0x1a'),_0x44516a,JSON[_0x4bc5('0x13')](_0x5436f7));_0x411454(_0x5436f7);})[_0x4bc5('0x19')](function(_0x4a7d9f){logger[_0x4bc5('0x14')]('ShowSmsAccount',_0x4a7d9f[_0x4bc5('0x17')],_0x44516a);_0x3c6b7d(_0x3194e8[_0x4bc5('0x14')](0x1f4,_0x4a7d9f['message']));});});};
\ No newline at end of file
+var _0x54f5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','register','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring'];(function(_0xaf9c97,_0x3acbd4){var _0x42ad92=function(_0x5a3b62){while(--_0x5a3b62){_0xaf9c97['push'](_0xaf9c97['shift']());}};_0x42ad92(++_0x3acbd4);}(_0x54f5,0x7c));var _0x554f=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x54f5[_0xfc406a];return _0x395473;};'use strict';var _=require('lodash');var util=require(_0x554f('0x0'));var moment=require(_0x554f('0x1'));var BPromise=require(_0x554f('0x2'));var rs=require(_0x554f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x554f('0x4'))['db'];var utils=require(_0x554f('0x5'));var logger=require(_0x554f('0x6'))(_0x554f('0x7'));var config=require(_0x554f('0x8'));var jayson=require(_0x554f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x554f('0xa')]=_['defaults'](config[_0x554f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x554f('0xa')]));require('./smsAccount.socket')[_0x554f('0xb')](socket);function respondWithRpcPromise(_0x4f61e7,_0x473281,_0x50cd66){return new BPromise(function(_0x1bac5c,_0x108dc8){return client['request'](_0x4f61e7,_0x50cd66)['then'](function(_0x5c3a60){logger[_0x554f('0xc')](_0x554f('0xd'),_0x473281,'request\x20sent');logger[_0x554f('0xe')](_0x554f('0xf'),_0x473281,_0x554f('0x10'),JSON[_0x554f('0x11')](_0x5c3a60));if(_0x5c3a60[_0x554f('0x12')]){if(_0x5c3a60['error'][_0x554f('0x13')]===0x1f4){logger[_0x554f('0x12')](_0x554f('0xd'),_0x473281,_0x5c3a60[_0x554f('0x12')]['message']);return _0x108dc8(_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);}logger[_0x554f('0x12')]('SmsAccount,\x20%s,\x20%s',_0x473281,_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);return _0x1bac5c(_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);}else{logger[_0x554f('0xc')](_0x554f('0xd'),_0x473281,_0x554f('0x10'));_0x1bac5c(_0x5c3a60[_0x554f('0x15')][_0x554f('0x14')]);}})[_0x554f('0x16')](function(_0x57f8a5){logger[_0x554f('0x12')](_0x554f('0xd'),_0x473281,_0x57f8a5);_0x108dc8(_0x57f8a5);});});}exports[_0x554f('0x17')]=function(_0x5caec6){var _0x4a9a6c=this;return new Promise(function(_0x552744,_0xff6d07){return db[_0x554f('0x18')][_0x554f('0x19')]({'raw':_0x5caec6[_0x554f('0x1a')]?_0x5caec6['options'][_0x554f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5caec6[_0x554f('0x1a')]?_0x5caec6[_0x554f('0x1a')]['where']||null:null,'attributes':_0x5caec6['options']?_0x5caec6[_0x554f('0x1a')][_0x554f('0x1c')]||null:null,'include':_0x5caec6['options']?_0x5caec6['options'][_0x554f('0x1d')]?_[_0x554f('0x1e')](_0x5caec6['options'][_0x554f('0x1d')],function(_0x5443d2){return{'model':db[_0x5443d2[_0x554f('0x1f')]],'as':_0x5443d2['as'],'attributes':_0x5443d2['attributes'],'include':_0x5443d2[_0x554f('0x1d')]?_['map'](_0x5443d2[_0x554f('0x1d')],function(_0x5b754a){return{'model':db[_0x5b754a[_0x554f('0x1f')]],'as':_0x5b754a['as'],'attributes':_0x5b754a['attributes'],'include':_0x5b754a['include']?_[_0x554f('0x1e')](_0x5b754a[_0x554f('0x1d')],function(_0x78216b){return{'model':db[_0x78216b[_0x554f('0x1f')]],'as':_0x78216b['as'],'attributes':_0x78216b[_0x554f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46e947){logger[_0x554f('0xc')](_0x554f('0x17'),_0x5caec6);logger['debug'](_0x554f('0x17'),_0x5caec6,JSON[_0x554f('0x11')](_0x46e947));_0x552744(_0x46e947);})[_0x554f('0x16')](function(_0x11f637){logger[_0x554f('0x12')](_0x554f('0x17'),_0x11f637[_0x554f('0x14')],_0x5caec6);_0xff6d07(_0x4a9a6c[_0x554f('0x12')](0x1f4,_0x11f637[_0x554f('0x14')]));});});};
\ No newline at end of file