Built motion from commit 4c281f94.|2.6.31
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index 2253685..1ce42fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa758=['error','code','message','result','catch','find','options','where','attributes','include','model','map','ShowSmsAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../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','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xa758,0xcb));var _0x8a75=function(_0x260b34,_0x225d94){_0x260b34=_0x260b34-0x0;var _0x1ceaca=_0xa758[_0x260b34];return _0x1ceaca;};'use strict';var _=require(_0x8a75('0x0'));var util=require(_0x8a75('0x1'));var moment=require(_0x8a75('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a75('0x3'));var db=require(_0x8a75('0x4'))['db'];var utils=require(_0x8a75('0x5'));var logger=require(_0x8a75('0x6'))(_0x8a75('0x7'));var config=require(_0x8a75('0x8'));var jayson=require(_0x8a75('0x9'));var client=jayson[_0x8a75('0xa')][_0x8a75('0xb')]({'port':0x232a});config[_0x8a75('0xc')]=_[_0x8a75('0xd')](config[_0x8a75('0xc')],{'host':_0x8a75('0xe'),'port':0x18eb});var socket=require(_0x8a75('0xf'))(new Redis(config['redis']));require(_0x8a75('0x10'))[_0x8a75('0x11')](socket);function respondWithRpcPromise(_0x4dbdf8,_0x773c73,_0x3ed1ae){return new BPromise(function(_0xa351f6,_0x4ec5cc){return client['request'](_0x4dbdf8,_0x3ed1ae)[_0x8a75('0x12')](function(_0x48a6a2){logger[_0x8a75('0x13')](_0x8a75('0x14'),_0x773c73,_0x8a75('0x15'));logger[_0x8a75('0x16')](_0x8a75('0x17'),_0x773c73,_0x8a75('0x15'),JSON[_0x8a75('0x18')](_0x48a6a2));if(_0x48a6a2[_0x8a75('0x19')]){if(_0x48a6a2[_0x8a75('0x19')][_0x8a75('0x1a')]===0x1f4){logger[_0x8a75('0x19')](_0x8a75('0x14'),_0x773c73,_0x48a6a2['error'][_0x8a75('0x1b')]);return _0x4ec5cc(_0x48a6a2['error']['message']);}logger[_0x8a75('0x19')](_0x8a75('0x14'),_0x773c73,_0x48a6a2[_0x8a75('0x19')][_0x8a75('0x1b')]);return _0xa351f6(_0x48a6a2[_0x8a75('0x19')]['message']);}else{logger[_0x8a75('0x13')](_0x8a75('0x14'),_0x773c73,_0x8a75('0x15'));_0xa351f6(_0x48a6a2[_0x8a75('0x1c')]['message']);}})[_0x8a75('0x1d')](function(_0xd7c9aa){logger[_0x8a75('0x19')](_0x8a75('0x14'),_0x773c73,_0xd7c9aa);_0x4ec5cc(_0xd7c9aa);});});}exports['ShowSmsAccount']=function(_0x201fec){var _0x2b21b6=this;return new Promise(function(_0x3e3d12,_0x331267){return db['SmsAccount'][_0x8a75('0x1e')]({'raw':_0x201fec['options']?_0x201fec['options']['raw']===undefined?!![]:![]:!![],'where':_0x201fec[_0x8a75('0x1f')]?_0x201fec[_0x8a75('0x1f')][_0x8a75('0x20')]||null:null,'attributes':_0x201fec[_0x8a75('0x1f')]?_0x201fec[_0x8a75('0x1f')][_0x8a75('0x21')]||null:null,'include':_0x201fec[_0x8a75('0x1f')]?_0x201fec[_0x8a75('0x1f')][_0x8a75('0x22')]?_['map'](_0x201fec[_0x8a75('0x1f')][_0x8a75('0x22')],function(_0x5c4da1){return{'model':db[_0x5c4da1[_0x8a75('0x23')]],'as':_0x5c4da1['as'],'attributes':_0x5c4da1['attributes'],'include':_0x5c4da1['include']?_['map'](_0x5c4da1[_0x8a75('0x22')],function(_0xfd8c25){return{'model':db[_0xfd8c25[_0x8a75('0x23')]],'as':_0xfd8c25['as'],'attributes':_0xfd8c25[_0x8a75('0x21')],'include':_0xfd8c25[_0x8a75('0x22')]?_[_0x8a75('0x24')](_0xfd8c25[_0x8a75('0x22')],function(_0x4a99fd){return{'model':db[_0x4a99fd[_0x8a75('0x23')]],'as':_0x4a99fd['as'],'attributes':_0x4a99fd[_0x8a75('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc954b){logger['info'](_0x8a75('0x25'),_0x201fec);logger['debug'](_0x8a75('0x25'),_0x201fec,JSON['stringify'](_0xbc954b));_0x3e3d12(_0xbc954b);})[_0x8a75('0x1d')](function(_0x2d08c8){logger['error']('ShowSmsAccount',_0x2d08c8[_0x8a75('0x1b')],_0x201fec);_0x331267(_0x2b21b6[_0x8a75('0x19')](0x1f4,_0x2d08c8['message']));});});};
\ No newline at end of file
+var _0x2f35=['catch','SmsAccount','find','options','raw','attributes','include','map','model','ShowSmsAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message'];(function(_0x10acb4,_0x2d4e4a){var _0x3b5665=function(_0xb788a3){while(--_0xb788a3){_0x10acb4['push'](_0x10acb4['shift']());}};_0x3b5665(++_0x2d4e4a);}(_0x2f35,0x1de));var _0x52f3=function(_0x58f65e,_0x467d61){_0x58f65e=_0x58f65e-0x0;var _0x35684b=_0x2f35[_0x58f65e];return _0x35684b;};'use strict';var _=require('lodash');var util=require(_0x52f3('0x0'));var moment=require(_0x52f3('0x1'));var BPromise=require(_0x52f3('0x2'));var rs=require(_0x52f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52f3('0x5'))(_0x52f3('0x6'));var config=require(_0x52f3('0x7'));var jayson=require(_0x52f3('0x8'));var client=jayson[_0x52f3('0x9')][_0x52f3('0xa')]({'port':0x232a});config[_0x52f3('0xb')]=_[_0x52f3('0xc')](config[_0x52f3('0xb')],{'host':_0x52f3('0xd'),'port':0x18eb});var socket=require(_0x52f3('0xe'))(new Redis(config[_0x52f3('0xb')]));require(_0x52f3('0xf'))[_0x52f3('0x10')](socket);function respondWithRpcPromise(_0x29c877,_0x59007c,_0x50a052){return new BPromise(function(_0x407dd5,_0x472c11){return client[_0x52f3('0x11')](_0x29c877,_0x50a052)[_0x52f3('0x12')](function(_0x34e023){logger[_0x52f3('0x13')]('SmsAccount,\x20%s,\x20%s',_0x59007c,_0x52f3('0x14'));logger[_0x52f3('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x59007c,'request\x20sent',JSON[_0x52f3('0x16')](_0x34e023));if(_0x34e023[_0x52f3('0x17')]){if(_0x34e023[_0x52f3('0x17')]['code']===0x1f4){logger[_0x52f3('0x17')](_0x52f3('0x18'),_0x59007c,_0x34e023[_0x52f3('0x17')]['message']);return _0x472c11(_0x34e023['error'][_0x52f3('0x19')]);}logger[_0x52f3('0x17')](_0x52f3('0x18'),_0x59007c,_0x34e023[_0x52f3('0x17')][_0x52f3('0x19')]);return _0x407dd5(_0x34e023['error'][_0x52f3('0x19')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x59007c,_0x52f3('0x14'));_0x407dd5(_0x34e023['result'][_0x52f3('0x19')]);}})[_0x52f3('0x1a')](function(_0x9c9c26){logger[_0x52f3('0x17')](_0x52f3('0x18'),_0x59007c,_0x9c9c26);_0x472c11(_0x9c9c26);});});}exports['ShowSmsAccount']=function(_0xd9cc91){var _0x36d210=this;return new Promise(function(_0x110998,_0x1d26d6){return db[_0x52f3('0x1b')][_0x52f3('0x1c')]({'raw':_0xd9cc91[_0x52f3('0x1d')]?_0xd9cc91['options'][_0x52f3('0x1e')]===undefined?!![]:![]:!![],'where':_0xd9cc91[_0x52f3('0x1d')]?_0xd9cc91[_0x52f3('0x1d')]['where']||null:null,'attributes':_0xd9cc91[_0x52f3('0x1d')]?_0xd9cc91[_0x52f3('0x1d')][_0x52f3('0x1f')]||null:null,'include':_0xd9cc91[_0x52f3('0x1d')]?_0xd9cc91['options'][_0x52f3('0x20')]?_[_0x52f3('0x21')](_0xd9cc91[_0x52f3('0x1d')][_0x52f3('0x20')],function(_0x3c5e92){return{'model':db[_0x3c5e92[_0x52f3('0x22')]],'as':_0x3c5e92['as'],'attributes':_0x3c5e92['attributes'],'include':_0x3c5e92[_0x52f3('0x20')]?_[_0x52f3('0x21')](_0x3c5e92[_0x52f3('0x20')],function(_0x1bf1b7){return{'model':db[_0x1bf1b7[_0x52f3('0x22')]],'as':_0x1bf1b7['as'],'attributes':_0x1bf1b7[_0x52f3('0x1f')],'include':_0x1bf1b7[_0x52f3('0x20')]?_[_0x52f3('0x21')](_0x1bf1b7[_0x52f3('0x20')],function(_0x6baca0){return{'model':db[_0x6baca0['model']],'as':_0x6baca0['as'],'attributes':_0x6baca0[_0x52f3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x115331){logger[_0x52f3('0x13')](_0x52f3('0x23'),_0xd9cc91);logger['debug'](_0x52f3('0x23'),_0xd9cc91,JSON['stringify'](_0x115331));_0x110998(_0x115331);})[_0x52f3('0x1a')](function(_0x7fe758){logger[_0x52f3('0x17')]('ShowSmsAccount',_0x7fe758[_0x52f3('0x19')],_0xd9cc91);_0x1d26d6(_0x36d210[_0x52f3('0x17')](0x1f4,_0x7fe758[_0x52f3('0x19')]));});});};
\ No newline at end of file