Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index 1b4ad72..9091eec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f57=['catch','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','stringify'];(function(_0x2adb6a,_0x6b50f3){var _0x575613=function(_0x3e9ebc){while(--_0x3e9ebc){_0x2adb6a['push'](_0x2adb6a['shift']());}};_0x575613(++_0x6b50f3);}(_0x2f57,0x104));var _0x72f5=function(_0xbb126a,_0x2223ac){_0xbb126a=_0xbb126a-0x0;var _0x9bbdf4=_0x2f57[_0xbb126a];return _0x9bbdf4;};'use strict';var _=require('lodash');var util=require(_0x72f5('0x0'));var moment=require('moment');var BPromise=require(_0x72f5('0x1'));var rs=require(_0x72f5('0x2'));var fs=require('fs');var Redis=require(_0x72f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x72f5('0x4'))(_0x72f5('0x5'));var config=require(_0x72f5('0x6'));var jayson=require(_0x72f5('0x7'));var client=jayson[_0x72f5('0x8')][_0x72f5('0x9')]({'port':0x232a});config[_0x72f5('0xa')]=_[_0x72f5('0xb')](config[_0x72f5('0xa')],{'host':_0x72f5('0xc'),'port':0x18eb});var socket=require(_0x72f5('0xd'))(new Redis(config[_0x72f5('0xa')]));require(_0x72f5('0xe'))[_0x72f5('0xf')](socket);function respondWithRpcPromise(_0x55ce47,_0x42f496,_0x4af632){return new BPromise(function(_0x2d2c52,_0x5c411){return client['request'](_0x55ce47,_0x4af632)[_0x72f5('0x10')](function(_0x2a26b4){logger[_0x72f5('0x11')](_0x72f5('0x12'),_0x42f496,_0x72f5('0x13'));logger[_0x72f5('0x14')](_0x72f5('0x15'),_0x42f496,'request\x20sent',JSON['stringify'](_0x2a26b4));if(_0x2a26b4[_0x72f5('0x16')]){if(_0x2a26b4[_0x72f5('0x16')]['code']===0x1f4){logger[_0x72f5('0x16')](_0x72f5('0x12'),_0x42f496,_0x2a26b4[_0x72f5('0x16')][_0x72f5('0x17')]);return _0x5c411(_0x2a26b4[_0x72f5('0x16')][_0x72f5('0x17')]);}logger['error'](_0x72f5('0x12'),_0x42f496,_0x2a26b4[_0x72f5('0x16')][_0x72f5('0x17')]);return _0x2d2c52(_0x2a26b4['error'][_0x72f5('0x17')]);}else{logger[_0x72f5('0x11')](_0x72f5('0x12'),_0x42f496,'request\x20sent');_0x2d2c52(_0x2a26b4[_0x72f5('0x18')][_0x72f5('0x17')]);}})['catch'](function(_0x374725){logger['error'](_0x72f5('0x12'),_0x42f496,_0x374725);_0x5c411(_0x374725);});});}exports[_0x72f5('0x19')]=function(_0x70aa25){var _0x44c204=this;return new Promise(function(_0x101da8,_0x3b65a3){return db[_0x72f5('0x1a')][_0x72f5('0x1b')]({'raw':_0x70aa25[_0x72f5('0x1c')]?_0x70aa25[_0x72f5('0x1c')][_0x72f5('0x1d')]===undefined?!![]:![]:!![],'where':_0x70aa25[_0x72f5('0x1c')]?_0x70aa25[_0x72f5('0x1c')][_0x72f5('0x1e')]||null:null,'attributes':_0x70aa25[_0x72f5('0x1c')]?_0x70aa25[_0x72f5('0x1c')][_0x72f5('0x1f')]||null:null,'include':_0x70aa25[_0x72f5('0x1c')]?_0x70aa25[_0x72f5('0x1c')][_0x72f5('0x20')]?_[_0x72f5('0x21')](_0x70aa25[_0x72f5('0x1c')][_0x72f5('0x20')],function(_0x45c8de){return{'model':db[_0x45c8de[_0x72f5('0x22')]],'as':_0x45c8de['as'],'attributes':_0x45c8de[_0x72f5('0x1f')],'include':_0x45c8de[_0x72f5('0x20')]?_[_0x72f5('0x21')](_0x45c8de[_0x72f5('0x20')],function(_0x138f0c){return{'model':db[_0x138f0c[_0x72f5('0x22')]],'as':_0x138f0c['as'],'attributes':_0x138f0c[_0x72f5('0x1f')],'include':_0x138f0c['include']?_[_0x72f5('0x21')](_0x138f0c[_0x72f5('0x20')],function(_0x3176bf){return{'model':db[_0x3176bf['model']],'as':_0x3176bf['as'],'attributes':_0x3176bf['attributes']};}):[]};}):[]};}):[]:[]})[_0x72f5('0x10')](function(_0x3bd05d){logger['info'](_0x72f5('0x19'),_0x70aa25);logger['debug'](_0x72f5('0x19'),_0x70aa25,JSON[_0x72f5('0x23')](_0x3bd05d));_0x101da8(_0x3bd05d);})[_0x72f5('0x24')](function(_0x1b614e){logger[_0x72f5('0x16')](_0x72f5('0x19'),_0x1b614e['message'],_0x70aa25);_0x3b65a3(_0x44c204[_0x72f5('0x16')](0x1f4,_0x1b614e['message']));});});};
\ No newline at end of file
+var _0x4153=['message','result','SmsAccount','find','options','where','attributes','include','model','map','then','ShowSmsAccount','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','socket.io-emitter','./smsAccount.socket','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21ecf3,_0x3b4b99){var _0x3cf63a=function(_0x536c67){while(--_0x536c67){_0x21ecf3['push'](_0x21ecf3['shift']());}};_0x3cf63a(++_0x3b4b99);}(_0x4153,0x10d));var _0x3415=function(_0x466113,_0x2d3f5c){_0x466113=_0x466113-0x0;var _0x2116e4=_0x4153[_0x466113];return _0x2116e4;};'use strict';var _=require('lodash');var util=require(_0x3415('0x0'));var moment=require(_0x3415('0x1'));var BPromise=require('bluebird');var rs=require(_0x3415('0x2'));var fs=require('fs');var Redis=require(_0x3415('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3415('0x4'));var logger=require(_0x3415('0x5'))(_0x3415('0x6'));var config=require('../../config/environment');var jayson=require(_0x3415('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3415('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3415('0x9'))(new Redis(config[_0x3415('0x8')]));require(_0x3415('0xa'))['register'](socket);function respondWithRpcPromise(_0x2c13a1,_0x550fd5,_0x2d442c){return new BPromise(function(_0x1df8d9,_0x283c72){return client['request'](_0x2c13a1,_0x2d442c)['then'](function(_0x35b2b0){logger[_0x3415('0xb')](_0x3415('0xc'),_0x550fd5,_0x3415('0xd'));logger[_0x3415('0xe')](_0x3415('0xf'),_0x550fd5,_0x3415('0xd'),JSON[_0x3415('0x10')](_0x35b2b0));if(_0x35b2b0[_0x3415('0x11')]){if(_0x35b2b0[_0x3415('0x11')][_0x3415('0x12')]===0x1f4){logger['error'](_0x3415('0xc'),_0x550fd5,_0x35b2b0[_0x3415('0x11')]['message']);return _0x283c72(_0x35b2b0['error']['message']);}logger['error'](_0x3415('0xc'),_0x550fd5,_0x35b2b0[_0x3415('0x11')][_0x3415('0x13')]);return _0x1df8d9(_0x35b2b0[_0x3415('0x11')][_0x3415('0x13')]);}else{logger['info'](_0x3415('0xc'),_0x550fd5,'request\x20sent');_0x1df8d9(_0x35b2b0[_0x3415('0x14')][_0x3415('0x13')]);}})['catch'](function(_0x4e71f8){logger['error'](_0x3415('0xc'),_0x550fd5,_0x4e71f8);_0x283c72(_0x4e71f8);});});}exports['ShowSmsAccount']=function(_0x3a7da0){var _0x1527a2=this;return new Promise(function(_0x5e0bbc,_0x1b2b89){return db[_0x3415('0x15')][_0x3415('0x16')]({'raw':_0x3a7da0['options']?_0x3a7da0[_0x3415('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3a7da0['options']?_0x3a7da0[_0x3415('0x17')][_0x3415('0x18')]||null:null,'attributes':_0x3a7da0[_0x3415('0x17')]?_0x3a7da0[_0x3415('0x17')][_0x3415('0x19')]||null:null,'include':_0x3a7da0[_0x3415('0x17')]?_0x3a7da0[_0x3415('0x17')][_0x3415('0x1a')]?_['map'](_0x3a7da0[_0x3415('0x17')][_0x3415('0x1a')],function(_0xe10d59){return{'model':db[_0xe10d59[_0x3415('0x1b')]],'as':_0xe10d59['as'],'attributes':_0xe10d59[_0x3415('0x19')],'include':_0xe10d59[_0x3415('0x1a')]?_[_0x3415('0x1c')](_0xe10d59[_0x3415('0x1a')],function(_0x44f501){return{'model':db[_0x44f501[_0x3415('0x1b')]],'as':_0x44f501['as'],'attributes':_0x44f501[_0x3415('0x19')],'include':_0x44f501[_0x3415('0x1a')]?_[_0x3415('0x1c')](_0x44f501['include'],function(_0x1df3a2){return{'model':db[_0x1df3a2['model']],'as':_0x1df3a2['as'],'attributes':_0x1df3a2[_0x3415('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3415('0x1d')](function(_0x56d4f8){logger[_0x3415('0xb')](_0x3415('0x1e'),_0x3a7da0);logger[_0x3415('0xe')](_0x3415('0x1e'),_0x3a7da0,JSON['stringify'](_0x56d4f8));_0x5e0bbc(_0x56d4f8);})[_0x3415('0x1f')](function(_0x235537){logger[_0x3415('0x11')](_0x3415('0x1e'),_0x235537['message'],_0x3a7da0);_0x1b2b89(_0x1527a2[_0x3415('0x11')](0x1f4,_0x235537['message']));});});};
\ No newline at end of file