X-Git-Url: http://repos.xcallymotion.com/?a=blobdiff_plain;f=server%2Fapi%2FsmsAccount%2FsmsAccount.rpc.js;h=40c72608d6160f9a998aed3533f741e99cca5015;hb=b9d8fb89c04e2712a06e4d6666f975c8e677d46a;hp=1b4ad7287df7d083be6af4fdbf22805b1cad00b7;hpb=d5b3d400e91cc98c429bfb9d7741cfdb9b495f82;p=motion2.git diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 1b4ad72..40c7260 100644 --- a/server/api/smsAccount/smsAccount.rpc.js +++ b/server/api/smsAccount/smsAccount.rpc.js @@ -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 _0x6e25=['request\x20sent','debug','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','include','map','attributes','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s'];(function(_0x4cab97,_0x16de8d){var _0x4ec5db=function(_0x3914bf){while(--_0x3914bf){_0x4cab97['push'](_0x4cab97['shift']());}};_0x4ec5db(++_0x16de8d);}(_0x6e25,0x154));var _0x56e2=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x6e25[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x56e2('0x0'));var util=require(_0x56e2('0x1'));var moment=require('moment');var BPromise=require(_0x56e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56e2('0x3'));var db=require(_0x56e2('0x4'))['db'];var utils=require(_0x56e2('0x5'));var logger=require(_0x56e2('0x6'))(_0x56e2('0x7'));var config=require(_0x56e2('0x8'));var jayson=require(_0x56e2('0x9'));var client=jayson[_0x56e2('0xa')][_0x56e2('0xb')]({'port':0x232a});config[_0x56e2('0xc')]=_[_0x56e2('0xd')](config['redis'],{'host':_0x56e2('0xe'),'port':0x18eb});var socket=require(_0x56e2('0xf'))(new Redis(config['redis']));require(_0x56e2('0x10'))['register'](socket);function respondWithRpcPromise(_0x599d9d,_0x2bd384,_0x47e445){return new BPromise(function(_0x33f025,_0x2bc2af){return client['request'](_0x599d9d,_0x47e445)[_0x56e2('0x11')](function(_0x3be49b){logger[_0x56e2('0x12')](_0x56e2('0x13'),_0x2bd384,_0x56e2('0x14'));logger[_0x56e2('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2bd384,'request\x20sent',JSON[_0x56e2('0x16')](_0x3be49b));if(_0x3be49b[_0x56e2('0x17')]){if(_0x3be49b['error']['code']===0x1f4){logger[_0x56e2('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2bd384,_0x3be49b[_0x56e2('0x17')]['message']);return _0x2bc2af(_0x3be49b[_0x56e2('0x17')][_0x56e2('0x18')]);}logger['error'](_0x56e2('0x13'),_0x2bd384,_0x3be49b[_0x56e2('0x17')]['message']);return _0x33f025(_0x3be49b[_0x56e2('0x17')][_0x56e2('0x18')]);}else{logger[_0x56e2('0x12')](_0x56e2('0x13'),_0x2bd384,'request\x20sent');_0x33f025(_0x3be49b[_0x56e2('0x19')][_0x56e2('0x18')]);}})[_0x56e2('0x1a')](function(_0x241599){logger[_0x56e2('0x17')]('SmsAccount,\x20%s,\x20%s',_0x2bd384,_0x241599);_0x2bc2af(_0x241599);});});}exports[_0x56e2('0x1b')]=function(_0x225979){var _0x2802c6=this;return new Promise(function(_0x5175c4,_0x5d5a3c){return db[_0x56e2('0x1c')]['find']({'raw':_0x225979['options']?_0x225979[_0x56e2('0x1d')][_0x56e2('0x1e')]===undefined?!![]:![]:!![],'where':_0x225979[_0x56e2('0x1d')]?_0x225979['options'][_0x56e2('0x1f')]||null:null,'attributes':_0x225979[_0x56e2('0x1d')]?_0x225979['options']['attributes']||null:null,'include':_0x225979[_0x56e2('0x1d')]?_0x225979[_0x56e2('0x1d')][_0x56e2('0x20')]?_[_0x56e2('0x21')](_0x225979[_0x56e2('0x1d')]['include'],function(_0x3d05fc){return{'model':db[_0x3d05fc['model']],'as':_0x3d05fc['as'],'attributes':_0x3d05fc[_0x56e2('0x22')],'include':_0x3d05fc[_0x56e2('0x20')]?_[_0x56e2('0x21')](_0x3d05fc[_0x56e2('0x20')],function(_0x4f9f83){return{'model':db[_0x4f9f83[_0x56e2('0x23')]],'as':_0x4f9f83['as'],'attributes':_0x4f9f83['attributes'],'include':_0x4f9f83[_0x56e2('0x20')]?_[_0x56e2('0x21')](_0x4f9f83['include'],function(_0x3865d3){return{'model':db[_0x3865d3[_0x56e2('0x23')]],'as':_0x3865d3['as'],'attributes':_0x3865d3[_0x56e2('0x22')]};}):[]};}):[]};}):[]:[]})[_0x56e2('0x11')](function(_0x1e3e79){logger['info'](_0x56e2('0x1b'),_0x225979);logger['debug'](_0x56e2('0x1b'),_0x225979,JSON['stringify'](_0x1e3e79));_0x5175c4(_0x1e3e79);})['catch'](function(_0x453169){logger[_0x56e2('0x17')]('ShowSmsAccount',_0x453169[_0x56e2('0x18')],_0x225979);_0x5d5a3c(_0x2802c6[_0x56e2('0x17')](0x1f4,_0x453169[_0x56e2('0x18')]));});});}; \ No newline at end of file