Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index c417570..7c0a6f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51a5=['options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','SmsAccount','find'];(function(_0x40f647,_0x3c5506){var _0x490649=function(_0xcb7c3b){while(--_0xcb7c3b){_0x40f647['push'](_0x40f647['shift']());}};_0x490649(++_0x3c5506);}(_0x51a5,0x155));var _0x551a=function(_0x4eee59,_0x195b9a){_0x4eee59=_0x4eee59-0x0;var _0x42194d=_0x51a5[_0x4eee59];return _0x42194d;};'use strict';var _=require(_0x551a('0x0'));var util=require(_0x551a('0x1'));var moment=require(_0x551a('0x2'));var BPromise=require(_0x551a('0x3'));var rs=require(_0x551a('0x4'));var fs=require('fs');var Redis=require(_0x551a('0x5'));var db=require(_0x551a('0x6'))['db'];var utils=require(_0x551a('0x7'));var logger=require(_0x551a('0x8'))(_0x551a('0x9'));var config=require(_0x551a('0xa'));var jayson=require(_0x551a('0xb'));var client=jayson[_0x551a('0xc')][_0x551a('0xd')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x551a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x551a('0xf')]));require(_0x551a('0x10'))[_0x551a('0x11')](socket);function respondWithRpcPromise(_0x2631f7,_0x573ec3,_0x3c1b59){return new BPromise(function(_0x54a226,_0x1c595f){return client[_0x551a('0x12')](_0x2631f7,_0x3c1b59)[_0x551a('0x13')](function(_0x3a19c7){logger[_0x551a('0x14')](_0x551a('0x15'),_0x573ec3,_0x551a('0x16'));logger[_0x551a('0x17')](_0x551a('0x18'),_0x573ec3,_0x551a('0x16'),JSON['stringify'](_0x3a19c7));if(_0x3a19c7[_0x551a('0x19')]){if(_0x3a19c7[_0x551a('0x19')]['code']===0x1f4){logger[_0x551a('0x19')]('SmsAccount,\x20%s,\x20%s',_0x573ec3,_0x3a19c7['error']['message']);return _0x1c595f(_0x3a19c7['error'][_0x551a('0x1a')]);}logger[_0x551a('0x19')](_0x551a('0x15'),_0x573ec3,_0x3a19c7[_0x551a('0x19')][_0x551a('0x1a')]);return _0x54a226(_0x3a19c7['error'][_0x551a('0x1a')]);}else{logger[_0x551a('0x14')](_0x551a('0x15'),_0x573ec3,_0x551a('0x16'));_0x54a226(_0x3a19c7['result'][_0x551a('0x1a')]);}})['catch'](function(_0x1f755b){logger[_0x551a('0x19')](_0x551a('0x15'),_0x573ec3,_0x1f755b);_0x1c595f(_0x1f755b);});});}exports['ShowSmsAccount']=function(_0x29aaae){var _0x223a1c=this;return new Promise(function(_0x338f49,_0x39fa4a){return db[_0x551a('0x1b')][_0x551a('0x1c')]({'raw':_0x29aaae[_0x551a('0x1d')]?_0x29aaae[_0x551a('0x1d')][_0x551a('0x1e')]===undefined?!![]:![]:!![],'where':_0x29aaae[_0x551a('0x1d')]?_0x29aaae[_0x551a('0x1d')][_0x551a('0x1f')]||null:null,'attributes':_0x29aaae[_0x551a('0x1d')]?_0x29aaae[_0x551a('0x1d')][_0x551a('0x20')]||null:null,'include':_0x29aaae[_0x551a('0x1d')]?_0x29aaae[_0x551a('0x1d')][_0x551a('0x21')]?_['map'](_0x29aaae[_0x551a('0x1d')][_0x551a('0x21')],function(_0x3691bb){return{'model':db[_0x3691bb['model']],'as':_0x3691bb['as'],'attributes':_0x3691bb[_0x551a('0x20')],'include':_0x3691bb['include']?_[_0x551a('0x22')](_0x3691bb[_0x551a('0x21')],function(_0x4e3d68){return{'model':db[_0x4e3d68[_0x551a('0x23')]],'as':_0x4e3d68['as'],'attributes':_0x4e3d68['attributes'],'include':_0x4e3d68[_0x551a('0x21')]?_[_0x551a('0x22')](_0x4e3d68['include'],function(_0xb70cbb){return{'model':db[_0xb70cbb['model']],'as':_0xb70cbb['as'],'attributes':_0xb70cbb['attributes']};}):[]};}):[]};}):[]:[]})[_0x551a('0x13')](function(_0xa7d172){logger[_0x551a('0x14')]('ShowSmsAccount',_0x29aaae);logger[_0x551a('0x17')]('ShowSmsAccount',_0x29aaae,JSON['stringify'](_0xa7d172));_0x338f49(_0xa7d172);})['catch'](function(_0x1c73a7){logger[_0x551a('0x19')](_0x551a('0x24'),_0x1c73a7['message'],_0x29aaae);_0x39fa4a(_0x223a1c['error'](0x1f4,_0x1c73a7[_0x551a('0x1a')]));});});};
\ No newline at end of file
+var _0x660d=['raw','where','attributes','include','model','map','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options'];(function(_0x44d360,_0xd05cb6){var _0x11c382=function(_0x2e103b){while(--_0x2e103b){_0x44d360['push'](_0x44d360['shift']());}};_0x11c382(++_0xd05cb6);}(_0x660d,0x1ce));var _0xd660=function(_0x1391da,_0x5bf609){_0x1391da=_0x1391da-0x0;var _0x41bff5=_0x660d[_0x1391da];return _0x41bff5;};'use strict';var _=require(_0xd660('0x0'));var util=require('util');var moment=require(_0xd660('0x1'));var BPromise=require(_0xd660('0x2'));var rs=require(_0xd660('0x3'));var fs=require('fs');var Redis=require(_0xd660('0x4'));var db=require(_0xd660('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd660('0x6'));var config=require('../../config/environment');var jayson=require(_0xd660('0x7'));var client=jayson[_0xd660('0x8')][_0xd660('0x9')]({'port':0x232a});config[_0xd660('0xa')]=_[_0xd660('0xb')](config[_0xd660('0xa')],{'host':_0xd660('0xc'),'port':0x18eb});var socket=require(_0xd660('0xd'))(new Redis(config[_0xd660('0xa')]));require(_0xd660('0xe'))[_0xd660('0xf')](socket);function respondWithRpcPromise(_0x48e3ed,_0x4c1d8e,_0xbcb8bc){return new BPromise(function(_0x3dfe75,_0x65d0fb){return client[_0xd660('0x10')](_0x48e3ed,_0xbcb8bc)[_0xd660('0x11')](function(_0x29705c){logger[_0xd660('0x12')](_0xd660('0x13'),_0x4c1d8e,_0xd660('0x14'));logger[_0xd660('0x15')](_0xd660('0x16'),_0x4c1d8e,_0xd660('0x14'),JSON[_0xd660('0x17')](_0x29705c));if(_0x29705c[_0xd660('0x18')]){if(_0x29705c['error'][_0xd660('0x19')]===0x1f4){logger[_0xd660('0x18')](_0xd660('0x13'),_0x4c1d8e,_0x29705c['error'][_0xd660('0x1a')]);return _0x65d0fb(_0x29705c[_0xd660('0x18')]['message']);}logger[_0xd660('0x18')](_0xd660('0x13'),_0x4c1d8e,_0x29705c['error'][_0xd660('0x1a')]);return _0x3dfe75(_0x29705c[_0xd660('0x18')][_0xd660('0x1a')]);}else{logger[_0xd660('0x12')](_0xd660('0x13'),_0x4c1d8e,_0xd660('0x14'));_0x3dfe75(_0x29705c[_0xd660('0x1b')][_0xd660('0x1a')]);}})[_0xd660('0x1c')](function(_0x417704){logger[_0xd660('0x18')](_0xd660('0x13'),_0x4c1d8e,_0x417704);_0x65d0fb(_0x417704);});});}exports[_0xd660('0x1d')]=function(_0x5deb3f){var _0x23661c=this;return new Promise(function(_0x36318e,_0x1ebd46){return db[_0xd660('0x1e')]['find']({'raw':_0x5deb3f[_0xd660('0x1f')]?_0x5deb3f[_0xd660('0x1f')][_0xd660('0x20')]===undefined?!![]:![]:!![],'where':_0x5deb3f[_0xd660('0x1f')]?_0x5deb3f[_0xd660('0x1f')][_0xd660('0x21')]||null:null,'attributes':_0x5deb3f[_0xd660('0x1f')]?_0x5deb3f[_0xd660('0x1f')][_0xd660('0x22')]||null:null,'include':_0x5deb3f[_0xd660('0x1f')]?_0x5deb3f[_0xd660('0x1f')][_0xd660('0x23')]?_['map'](_0x5deb3f[_0xd660('0x1f')][_0xd660('0x23')],function(_0x44b673){return{'model':db[_0x44b673[_0xd660('0x24')]],'as':_0x44b673['as'],'attributes':_0x44b673[_0xd660('0x22')],'include':_0x44b673[_0xd660('0x23')]?_[_0xd660('0x25')](_0x44b673[_0xd660('0x23')],function(_0x3d51fa){return{'model':db[_0x3d51fa[_0xd660('0x24')]],'as':_0x3d51fa['as'],'attributes':_0x3d51fa['attributes'],'include':_0x3d51fa[_0xd660('0x23')]?_[_0xd660('0x25')](_0x3d51fa[_0xd660('0x23')],function(_0x195798){return{'model':db[_0x195798[_0xd660('0x24')]],'as':_0x195798['as'],'attributes':_0x195798[_0xd660('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd660('0x11')](function(_0xb93906){logger['info'](_0xd660('0x1d'),_0x5deb3f);logger[_0xd660('0x15')]('ShowSmsAccount',_0x5deb3f,JSON['stringify'](_0xb93906));_0x36318e(_0xb93906);})[_0xd660('0x1c')](function(_0x14e821){logger['error'](_0xd660('0x1d'),_0x14e821[_0xd660('0x1a')],_0x5deb3f);_0x1ebd46(_0x23661c[_0xd660('0x18')](0x1f4,_0x14e821[_0xd660('0x1a')]));});});};
\ No newline at end of file