Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / smsMessage / smsMessage.rpc.js
index 2d98879..f718a76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f7=['register','then','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x129f62,_0x1cdf67){var _0x2ea030=function(_0x2a3ae){while(--_0x2a3ae){_0x129f62['push'](_0x129f62['shift']());}};_0x2ea030(++_0x1cdf67);}(_0x68f7,0x1a5));var _0x768f=function(_0x53be2f,_0x2b041e){_0x53be2f=_0x53be2f-0x0;var _0x225286=_0x68f7[_0x53be2f];return _0x225286;};'use strict';var _=require('lodash');var util=require(_0x768f('0x0'));var moment=require('moment');var BPromise=require(_0x768f('0x1'));var rs=require(_0x768f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x768f('0x3'))['db'];var utils=require(_0x768f('0x4'));var logger=require(_0x768f('0x5'))('rpc');var config=require(_0x768f('0x6'));var jayson=require(_0x768f('0x7'));var client=jayson[_0x768f('0x8')]['http']({'port':0x232a});config[_0x768f('0x9')]=_[_0x768f('0xa')](config['redis'],{'host':_0x768f('0xb'),'port':0x18eb});var socket=require(_0x768f('0xc'))(new Redis(config[_0x768f('0x9')]));require('./smsMessage.socket')[_0x768f('0xd')](socket);function respondWithRpcPromise(_0x59aa57,_0x2b1200,_0xa319a1){return new BPromise(function(_0x2fa08b,_0x288a02){return client['request'](_0x59aa57,_0xa319a1)[_0x768f('0xe')](function(_0x2bfc49){logger[_0x768f('0xf')]('SmsMessage,\x20%s,\x20%s',_0x2b1200,_0x768f('0x10'));logger[_0x768f('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2b1200,_0x768f('0x10'),JSON[_0x768f('0x12')](_0x2bfc49));if(_0x2bfc49['error']){if(_0x2bfc49[_0x768f('0x13')][_0x768f('0x14')]===0x1f4){logger[_0x768f('0x13')](_0x768f('0x15'),_0x2b1200,_0x2bfc49[_0x768f('0x13')][_0x768f('0x16')]);return _0x288a02(_0x2bfc49[_0x768f('0x13')][_0x768f('0x16')]);}logger[_0x768f('0x13')](_0x768f('0x15'),_0x2b1200,_0x2bfc49['error'][_0x768f('0x16')]);return _0x2fa08b(_0x2bfc49['error'][_0x768f('0x16')]);}else{logger[_0x768f('0xf')](_0x768f('0x15'),_0x2b1200,_0x768f('0x10'));_0x2fa08b(_0x2bfc49[_0x768f('0x17')][_0x768f('0x16')]);}})[_0x768f('0x18')](function(_0x764754){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b1200,_0x764754);_0x288a02(_0x764754);});});}exports[_0x768f('0x19')]=function(_0x33ef14){var _0x1a3a8d=this;return new Promise(function(_0x2c3043,_0x3f3523){return db[_0x768f('0x1a')][_0x768f('0x1b')](_0x33ef14[_0x768f('0x1c')],{'raw':_0x33ef14[_0x768f('0x1d')]?_0x33ef14[_0x768f('0x1d')][_0x768f('0x1e')]===undefined?!![]:![]:!![]})[_0x768f('0xe')](function(_0x380cfc){logger[_0x768f('0xf')](_0x768f('0x19'),_0x33ef14);logger['debug']('CreateSmsMessage',_0x33ef14,JSON[_0x768f('0x12')](_0x380cfc));_0x2c3043(_0x380cfc);})['catch'](function(_0x2a7171){logger[_0x768f('0x13')](_0x768f('0x19'),_0x2a7171[_0x768f('0x16')],_0x33ef14);_0x3f3523(_0x1a3a8d['error'](0x1f4,_0x2a7171[_0x768f('0x16')]));});});};
\ No newline at end of file
+var _0xcbca=['message','SmsMessage,\x20%s,\x20%s','info','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x1cd6a7,_0x3de156){var _0x1033e4=function(_0x3798e2){while(--_0x3798e2){_0x1cd6a7['push'](_0x1cd6a7['shift']());}};_0x1033e4(++_0x3de156);}(_0xcbca,0x96));var _0xacbc=function(_0x256ffb,_0x103b45){_0x256ffb=_0x256ffb-0x0;var _0x2ab707=_0xcbca[_0x256ffb];return _0x2ab707;};'use strict';var _=require(_0xacbc('0x0'));var util=require(_0xacbc('0x1'));var moment=require(_0xacbc('0x2'));var BPromise=require(_0xacbc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xacbc('0x5'));var logger=require(_0xacbc('0x6'))(_0xacbc('0x7'));var config=require(_0xacbc('0x8'));var jayson=require(_0xacbc('0x9'));var client=jayson[_0xacbc('0xa')][_0xacbc('0xb')]({'port':0x232a});config[_0xacbc('0xc')]=_[_0xacbc('0xd')](config[_0xacbc('0xc')],{'host':_0xacbc('0xe'),'port':0x18eb});var socket=require(_0xacbc('0xf'))(new Redis(config[_0xacbc('0xc')]));require(_0xacbc('0x10'))[_0xacbc('0x11')](socket);function respondWithRpcPromise(_0x2cc127,_0x60e5fc,_0x181793){return new BPromise(function(_0x2b5343,_0x35c218){return client[_0xacbc('0x12')](_0x2cc127,_0x181793)[_0xacbc('0x13')](function(_0x24ff1f){logger['info']('SmsMessage,\x20%s,\x20%s',_0x60e5fc,'request\x20sent');logger[_0xacbc('0x14')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x60e5fc,_0xacbc('0x15'),JSON[_0xacbc('0x16')](_0x24ff1f));if(_0x24ff1f['error']){if(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x18')]===0x1f4){logger[_0xacbc('0x17')]('SmsMessage,\x20%s,\x20%s',_0x60e5fc,_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);return _0x35c218(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);}logger[_0xacbc('0x17')](_0xacbc('0x1a'),_0x60e5fc,_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);return _0x2b5343(_0x24ff1f[_0xacbc('0x17')][_0xacbc('0x19')]);}else{logger[_0xacbc('0x1b')](_0xacbc('0x1a'),_0x60e5fc,_0xacbc('0x15'));_0x2b5343(_0x24ff1f['result'][_0xacbc('0x19')]);}})[_0xacbc('0x1c')](function(_0x2d1c79){logger[_0xacbc('0x17')](_0xacbc('0x1a'),_0x60e5fc,_0x2d1c79);_0x35c218(_0x2d1c79);});});}exports[_0xacbc('0x1d')]=function(_0x29decc){var _0x43f0d0=this;return new Promise(function(_0xfc0ab7,_0x151f35){return db[_0xacbc('0x1e')][_0xacbc('0x1f')](_0x29decc[_0xacbc('0x20')],{'raw':_0x29decc[_0xacbc('0x21')]?_0x29decc['options'][_0xacbc('0x22')]===undefined?!![]:![]:!![]})[_0xacbc('0x13')](function(_0x20d2a9){logger[_0xacbc('0x1b')](_0xacbc('0x1d'),_0x29decc);logger[_0xacbc('0x14')]('CreateSmsMessage',_0x29decc,JSON[_0xacbc('0x16')](_0x20d2a9));_0xfc0ab7(_0x20d2a9);})[_0xacbc('0x1c')](function(_0x17e23a){logger[_0xacbc('0x17')]('CreateSmsMessage',_0x17e23a[_0xacbc('0x19')],_0x29decc);_0x151f35(_0x43f0d0[_0xacbc('0x17')](0x1f4,_0x17e23a['message']));});});};
\ No newline at end of file