Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / api / smsAccount / smsAccount.rpc.js
index d27bbd8..fbc66f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8942=['map','include','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./smsAccount.socket','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','options','where','attributes'];(function(_0x2de13e,_0x5389e8){var _0x2b6572=function(_0x489d30){while(--_0x489d30){_0x2de13e['push'](_0x2de13e['shift']());}};_0x2b6572(++_0x5389e8);}(_0x8942,0x123));var _0x2894=function(_0x36f96c,_0x32345b){_0x36f96c=_0x36f96c-0x0;var _0x58a276=_0x8942[_0x36f96c];return _0x58a276;};'use strict';var _=require(_0x2894('0x0'));var util=require(_0x2894('0x1'));var moment=require(_0x2894('0x2'));var BPromise=require(_0x2894('0x3'));var rs=require(_0x2894('0x4'));var fs=require('fs');var Redis=require(_0x2894('0x5'));var db=require(_0x2894('0x6'))['db'];var utils=require(_0x2894('0x7'));var logger=require(_0x2894('0x8'))(_0x2894('0x9'));var config=require(_0x2894('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2894('0xb')]({'port':0x232a});config[_0x2894('0xc')]=_[_0x2894('0xd')](config[_0x2894('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2894('0xe'))(new Redis(config['redis']));require(_0x2894('0xf'))['register'](socket);function respondWithRpcPromise(_0xe95404,_0x1c96b1,_0x13b821){return new BPromise(function(_0x449f9c,_0x3b8b9d){return client['request'](_0xe95404,_0x13b821)['then'](function(_0x1223e4){logger[_0x2894('0x10')](_0x2894('0x11'),_0x1c96b1,'request\x20sent');logger[_0x2894('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1c96b1,_0x2894('0x13'),JSON[_0x2894('0x14')](_0x1223e4));if(_0x1223e4['error']){if(_0x1223e4[_0x2894('0x15')][_0x2894('0x16')]===0x1f4){logger[_0x2894('0x15')](_0x2894('0x11'),_0x1c96b1,_0x1223e4[_0x2894('0x15')][_0x2894('0x17')]);return _0x3b8b9d(_0x1223e4[_0x2894('0x15')][_0x2894('0x17')]);}logger['error'](_0x2894('0x11'),_0x1c96b1,_0x1223e4[_0x2894('0x15')][_0x2894('0x17')]);return _0x449f9c(_0x1223e4[_0x2894('0x15')][_0x2894('0x17')]);}else{logger[_0x2894('0x10')](_0x2894('0x11'),_0x1c96b1,_0x2894('0x13'));_0x449f9c(_0x1223e4[_0x2894('0x18')][_0x2894('0x17')]);}})[_0x2894('0x19')](function(_0x401982){logger[_0x2894('0x15')](_0x2894('0x11'),_0x1c96b1,_0x401982);_0x3b8b9d(_0x401982);});});}exports['ShowSmsAccount']=function(_0x3541d1){var _0x4bdbfd=this;return new Promise(function(_0xd774fe,_0x1168ae){return db['SmsAccount']['find']({'raw':_0x3541d1['options']?_0x3541d1[_0x2894('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3541d1[_0x2894('0x1a')]?_0x3541d1[_0x2894('0x1a')][_0x2894('0x1b')]||null:null,'attributes':_0x3541d1[_0x2894('0x1a')]?_0x3541d1[_0x2894('0x1a')][_0x2894('0x1c')]||null:null,'include':_0x3541d1[_0x2894('0x1a')]?_0x3541d1[_0x2894('0x1a')]['include']?_[_0x2894('0x1d')](_0x3541d1[_0x2894('0x1a')][_0x2894('0x1e')],function(_0x42e892){return{'model':db[_0x42e892['model']],'as':_0x42e892['as'],'attributes':_0x42e892['attributes'],'include':_0x42e892[_0x2894('0x1e')]?_['map'](_0x42e892[_0x2894('0x1e')],function(_0x152651){return{'model':db[_0x152651['model']],'as':_0x152651['as'],'attributes':_0x152651[_0x2894('0x1c')],'include':_0x152651[_0x2894('0x1e')]?_[_0x2894('0x1d')](_0x152651[_0x2894('0x1e')],function(_0x52fc39){return{'model':db[_0x52fc39['model']],'as':_0x52fc39['as'],'attributes':_0x52fc39[_0x2894('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bdc30){logger['info'](_0x2894('0x1f'),_0x3541d1);logger[_0x2894('0x12')]('ShowSmsAccount',_0x3541d1,JSON[_0x2894('0x14')](_0x5bdc30));_0xd774fe(_0x5bdc30);})[_0x2894('0x19')](function(_0x40c7c8){logger[_0x2894('0x15')](_0x2894('0x1f'),_0x40c7c8[_0x2894('0x17')],_0x3541d1);_0x1168ae(_0x4bdbfd[_0x2894('0x15')](0x1f4,_0x40c7c8[_0x2894('0x17')]));});});};
\ No newline at end of file
+var _0xcbc1=['include','map','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','ShowSmsAccount','find','options','raw','where','attributes'];(function(_0x325890,_0x4cd3b8){var _0x44a15a=function(_0x17de7b){while(--_0x17de7b){_0x325890['push'](_0x325890['shift']());}};_0x44a15a(++_0x4cd3b8);}(_0xcbc1,0x100));var _0x1cbc=function(_0x5e6c41,_0x11e182){_0x5e6c41=_0x5e6c41-0x0;var _0x254e22=_0xcbc1[_0x5e6c41];return _0x254e22;};'use strict';var _=require(_0x1cbc('0x0'));var util=require(_0x1cbc('0x1'));var moment=require(_0x1cbc('0x2'));var BPromise=require(_0x1cbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cbc('0x4'));var db=require(_0x1cbc('0x5'))['db'];var utils=require(_0x1cbc('0x6'));var logger=require(_0x1cbc('0x7'))(_0x1cbc('0x8'));var config=require(_0x1cbc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1cbc('0xa')][_0x1cbc('0xb')]({'port':0x232a});config[_0x1cbc('0xc')]=_['defaults'](config[_0x1cbc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1cbc('0xd'))(new Redis(config['redis']));require(_0x1cbc('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ca09d,_0xd71850,_0x5d9b23){return new BPromise(function(_0xe296cf,_0x3b177c){return client[_0x1cbc('0xf')](_0x4ca09d,_0x5d9b23)[_0x1cbc('0x10')](function(_0x1273fb){logger[_0x1cbc('0x11')](_0x1cbc('0x12'),_0xd71850,'request\x20sent');logger['debug'](_0x1cbc('0x13'),_0xd71850,'request\x20sent',JSON[_0x1cbc('0x14')](_0x1273fb));if(_0x1273fb[_0x1cbc('0x15')]){if(_0x1273fb['error']['code']===0x1f4){logger[_0x1cbc('0x15')](_0x1cbc('0x12'),_0xd71850,_0x1273fb['error'][_0x1cbc('0x16')]);return _0x3b177c(_0x1273fb[_0x1cbc('0x15')][_0x1cbc('0x16')]);}logger['error'](_0x1cbc('0x12'),_0xd71850,_0x1273fb[_0x1cbc('0x15')][_0x1cbc('0x16')]);return _0xe296cf(_0x1273fb[_0x1cbc('0x15')][_0x1cbc('0x16')]);}else{logger[_0x1cbc('0x11')]('SmsAccount,\x20%s,\x20%s',_0xd71850,_0x1cbc('0x17'));_0xe296cf(_0x1273fb[_0x1cbc('0x18')][_0x1cbc('0x16')]);}})[_0x1cbc('0x19')](function(_0x455ebb){logger[_0x1cbc('0x15')]('SmsAccount,\x20%s,\x20%s',_0xd71850,_0x455ebb);_0x3b177c(_0x455ebb);});});}exports[_0x1cbc('0x1a')]=function(_0x371621){var _0xe6160=this;return new Promise(function(_0x52a390,_0x1651d0){return db['SmsAccount'][_0x1cbc('0x1b')]({'raw':_0x371621[_0x1cbc('0x1c')]?_0x371621[_0x1cbc('0x1c')][_0x1cbc('0x1d')]===undefined?!![]:![]:!![],'where':_0x371621['options']?_0x371621[_0x1cbc('0x1c')][_0x1cbc('0x1e')]||null:null,'attributes':_0x371621[_0x1cbc('0x1c')]?_0x371621[_0x1cbc('0x1c')][_0x1cbc('0x1f')]||null:null,'include':_0x371621[_0x1cbc('0x1c')]?_0x371621[_0x1cbc('0x1c')][_0x1cbc('0x20')]?_[_0x1cbc('0x21')](_0x371621['options'][_0x1cbc('0x20')],function(_0x1f6415){return{'model':db[_0x1f6415[_0x1cbc('0x22')]],'as':_0x1f6415['as'],'attributes':_0x1f6415['attributes'],'include':_0x1f6415[_0x1cbc('0x20')]?_[_0x1cbc('0x21')](_0x1f6415[_0x1cbc('0x20')],function(_0x3a8dfa){return{'model':db[_0x3a8dfa[_0x1cbc('0x22')]],'as':_0x3a8dfa['as'],'attributes':_0x3a8dfa[_0x1cbc('0x1f')],'include':_0x3a8dfa[_0x1cbc('0x20')]?_[_0x1cbc('0x21')](_0x3a8dfa[_0x1cbc('0x20')],function(_0x59069f){return{'model':db[_0x59069f['model']],'as':_0x59069f['as'],'attributes':_0x59069f[_0x1cbc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1cbc('0x10')](function(_0x2380b6){logger['info'](_0x1cbc('0x1a'),_0x371621);logger[_0x1cbc('0x23')](_0x1cbc('0x1a'),_0x371621,JSON[_0x1cbc('0x14')](_0x2380b6));_0x52a390(_0x2380b6);})[_0x1cbc('0x19')](function(_0x50b4be){logger[_0x1cbc('0x15')](_0x1cbc('0x1a'),_0x50b4be[_0x1cbc('0x16')],_0x371621);_0x1651d0(_0xe6160['error'](0x1f4,_0x50b4be[_0x1cbc('0x16')]));});});};
\ No newline at end of file