Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 77f953e..c99db4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8261=['catch','options','raw','attributes','limit','include','model','map','GetSmsQueue','ShowSmsQueue','find','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','socket.io-emitter','request','then','info','SmsQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x116482,_0x35ddae){var _0x56db37=function(_0xc3685c){while(--_0xc3685c){_0x116482['push'](_0x116482['shift']());}};_0x56db37(++_0x35ddae);}(_0x8261,0x13e));var _0x1826=function(_0xcbf460,_0x514e17){_0xcbf460=_0xcbf460-0x0;var _0xe34fe2=_0x8261[_0xcbf460];return _0xe34fe2;};'use strict';var _=require('lodash');var util=require(_0x1826('0x0'));var moment=require('moment');var BPromise=require(_0x1826('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1826('0x2'));var db=require(_0x1826('0x3'))['db'];var utils=require(_0x1826('0x4'));var logger=require(_0x1826('0x5'))(_0x1826('0x6'));var config=require('../../config/environment');var jayson=require(_0x1826('0x7'));var client=jayson['client'][_0x1826('0x8')]({'port':0x232a});config[_0x1826('0x9')]=_['defaults'](config[_0x1826('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1826('0xa'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0xbfabbb,_0x20b06a,_0x5d4a71){return new BPromise(function(_0x489725,_0xe6af99){return client[_0x1826('0xb')](_0xbfabbb,_0x5d4a71)[_0x1826('0xc')](function(_0x330501){logger[_0x1826('0xd')](_0x1826('0xe'),_0x20b06a,'request\x20sent');logger[_0x1826('0xf')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x20b06a,'request\x20sent',JSON[_0x1826('0x10')](_0x330501));if(_0x330501[_0x1826('0x11')]){if(_0x330501['error'][_0x1826('0x12')]===0x1f4){logger[_0x1826('0x11')](_0x1826('0xe'),_0x20b06a,_0x330501['error'][_0x1826('0x13')]);return _0xe6af99(_0x330501[_0x1826('0x11')][_0x1826('0x13')]);}logger['error'](_0x1826('0xe'),_0x20b06a,_0x330501[_0x1826('0x11')][_0x1826('0x13')]);return _0x489725(_0x330501[_0x1826('0x11')][_0x1826('0x13')]);}else{logger[_0x1826('0xd')](_0x1826('0xe'),_0x20b06a,_0x1826('0x14'));_0x489725(_0x330501[_0x1826('0x15')][_0x1826('0x13')]);}})[_0x1826('0x16')](function(_0xce251a){logger['error']('SmsQueue,\x20%s,\x20%s',_0x20b06a,_0xce251a);_0xe6af99(_0xce251a);});});}exports['GetSmsQueue']=function(_0x12965e){var _0x1cc98b=this;return new Promise(function(_0x4f8399,_0x57f57b){return db['SmsQueue']['findAll']({'raw':_0x12965e[_0x1826('0x17')]?_0x12965e['options'][_0x1826('0x18')]===undefined?!![]:![]:!![],'where':_0x12965e[_0x1826('0x17')]?_0x12965e[_0x1826('0x17')]['where']||null:null,'attributes':_0x12965e[_0x1826('0x17')]?_0x12965e[_0x1826('0x17')][_0x1826('0x19')]||null:null,'limit':_0x12965e[_0x1826('0x17')]?_0x12965e[_0x1826('0x17')][_0x1826('0x1a')]||null:null,'include':_0x12965e['options']?_0x12965e['options'][_0x1826('0x1b')]?_['map'](_0x12965e['options'][_0x1826('0x1b')],function(_0x386535){return{'model':db[_0x386535[_0x1826('0x1c')]],'as':_0x386535['as'],'attributes':_0x386535[_0x1826('0x19')],'include':_0x386535['include']?_[_0x1826('0x1d')](_0x386535['include'],function(_0x4a3963){return{'model':db[_0x4a3963[_0x1826('0x1c')]],'as':_0x4a3963['as'],'attributes':_0x4a3963[_0x1826('0x19')],'include':_0x4a3963[_0x1826('0x1b')]?_[_0x1826('0x1d')](_0x4a3963[_0x1826('0x1b')],function(_0x1b2081){return{'model':db[_0x1b2081[_0x1826('0x1c')]],'as':_0x1b2081['as'],'attributes':_0x1b2081['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e550c){logger['info']('GetSmsQueue',_0x12965e);logger[_0x1826('0xf')](_0x1826('0x1e'),_0x12965e,JSON[_0x1826('0x10')](_0x5e550c));_0x4f8399(_0x5e550c);})['catch'](function(_0x480f83){logger[_0x1826('0x11')](_0x1826('0x1e'),_0x480f83[_0x1826('0x13')],_0x12965e);_0x57f57b(_0x1cc98b['error'](0x1f4,_0x480f83[_0x1826('0x13')]));});});};exports[_0x1826('0x1f')]=function(_0x345fb3){var _0x5f2c30=this;return new Promise(function(_0x55325f,_0x1196f0){return db['SmsQueue'][_0x1826('0x20')]({'raw':_0x345fb3[_0x1826('0x17')]?_0x345fb3[_0x1826('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x345fb3[_0x1826('0x17')]?_0x345fb3[_0x1826('0x17')][_0x1826('0x21')]||null:null,'attributes':_0x345fb3[_0x1826('0x17')]?_0x345fb3[_0x1826('0x17')]['attributes']||null:null,'include':_0x345fb3[_0x1826('0x17')]?_0x345fb3[_0x1826('0x17')][_0x1826('0x1b')]?_['map'](_0x345fb3['options'][_0x1826('0x1b')],function(_0x239a32){return{'model':db[_0x239a32[_0x1826('0x1c')]],'as':_0x239a32['as'],'attributes':_0x239a32[_0x1826('0x19')],'include':_0x239a32['include']?_[_0x1826('0x1d')](_0x239a32[_0x1826('0x1b')],function(_0xd74c70){return{'model':db[_0xd74c70[_0x1826('0x1c')]],'as':_0xd74c70['as'],'attributes':_0xd74c70['attributes'],'include':_0xd74c70[_0x1826('0x1b')]?_[_0x1826('0x1d')](_0xd74c70[_0x1826('0x1b')],function(_0x24cd40){return{'model':db[_0x24cd40['model']],'as':_0x24cd40['as'],'attributes':_0x24cd40[_0x1826('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x173707){logger[_0x1826('0xd')]('ShowSmsQueue',_0x345fb3);logger[_0x1826('0xf')](_0x1826('0x1f'),_0x345fb3,JSON[_0x1826('0x10')](_0x173707));_0x55325f(_0x173707);})[_0x1826('0x16')](function(_0x173f31){logger[_0x1826('0x11')]('ShowSmsQueue',_0x173f31[_0x1826('0x13')],_0x345fb3);_0x1196f0(_0x5f2c30['error'](0x1f4,_0x173f31[_0x1826('0x13')]));});});};
\ No newline at end of file
+var _0x325f=['./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowSmsQueue','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x325f,0x105));var _0xf325=function(_0x34d7d3,_0x301c15){_0x34d7d3=_0x34d7d3-0x0;var _0x2f04e3=_0x325f[_0x34d7d3];return _0x2f04e3;};'use strict';var _=require(_0xf325('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf325('0x1'));var rs=require(_0xf325('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf325('0x3'))['db'];var utils=require(_0xf325('0x4'));var logger=require(_0xf325('0x5'))(_0xf325('0x6'));var config=require('../../config/environment');var jayson=require(_0xf325('0x7'));var client=jayson[_0xf325('0x8')][_0xf325('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf325('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf325('0xb'))(new Redis(config[_0xf325('0xa')]));require(_0xf325('0xc'))[_0xf325('0xd')](socket);function respondWithRpcPromise(_0x2e65b6,_0x34e5e8,_0x19506a){return new BPromise(function(_0x4512f0,_0x3fad77){return client[_0xf325('0xe')](_0x2e65b6,_0x19506a)[_0xf325('0xf')](function(_0x4c4933){logger[_0xf325('0x10')](_0xf325('0x11'),_0x34e5e8,_0xf325('0x12'));logger[_0xf325('0x13')](_0xf325('0x14'),_0x34e5e8,_0xf325('0x12'),JSON['stringify'](_0x4c4933));if(_0x4c4933[_0xf325('0x15')]){if(_0x4c4933[_0xf325('0x15')][_0xf325('0x16')]===0x1f4){logger[_0xf325('0x15')](_0xf325('0x11'),_0x34e5e8,_0x4c4933[_0xf325('0x15')]['message']);return _0x3fad77(_0x4c4933['error']['message']);}logger[_0xf325('0x15')](_0xf325('0x11'),_0x34e5e8,_0x4c4933[_0xf325('0x15')][_0xf325('0x17')]);return _0x4512f0(_0x4c4933[_0xf325('0x15')]['message']);}else{logger[_0xf325('0x10')](_0xf325('0x11'),_0x34e5e8,_0xf325('0x12'));_0x4512f0(_0x4c4933['result'][_0xf325('0x17')]);}})[_0xf325('0x18')](function(_0x31c784){logger['error'](_0xf325('0x11'),_0x34e5e8,_0x31c784);_0x3fad77(_0x31c784);});});}exports[_0xf325('0x19')]=function(_0x53872a){var _0x43aa7c=this;return new Promise(function(_0x2ab046,_0x4a794d){return db[_0xf325('0x1a')][_0xf325('0x1b')]({'raw':_0x53872a[_0xf325('0x1c')]?_0x53872a['options'][_0xf325('0x1d')]===undefined?!![]:![]:!![],'where':_0x53872a[_0xf325('0x1c')]?_0x53872a['options'][_0xf325('0x1e')]||null:null,'attributes':_0x53872a[_0xf325('0x1c')]?_0x53872a['options'][_0xf325('0x1f')]||null:null,'limit':_0x53872a[_0xf325('0x1c')]?_0x53872a[_0xf325('0x1c')][_0xf325('0x20')]||null:null,'include':_0x53872a[_0xf325('0x1c')]?_0x53872a[_0xf325('0x1c')]['include']?_[_0xf325('0x21')](_0x53872a[_0xf325('0x1c')][_0xf325('0x22')],function(_0x49ab68){return{'model':db[_0x49ab68['model']],'as':_0x49ab68['as'],'attributes':_0x49ab68[_0xf325('0x1f')],'include':_0x49ab68[_0xf325('0x22')]?_[_0xf325('0x21')](_0x49ab68[_0xf325('0x22')],function(_0x4d2ecc){return{'model':db[_0x4d2ecc[_0xf325('0x23')]],'as':_0x4d2ecc['as'],'attributes':_0x4d2ecc[_0xf325('0x1f')],'include':_0x4d2ecc[_0xf325('0x22')]?_[_0xf325('0x21')](_0x4d2ecc[_0xf325('0x22')],function(_0xb3841e){return{'model':db[_0xb3841e['model']],'as':_0xb3841e['as'],'attributes':_0xb3841e[_0xf325('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf325('0xf')](function(_0x2ce7f2){logger[_0xf325('0x10')](_0xf325('0x19'),_0x53872a);logger[_0xf325('0x13')]('GetSmsQueue',_0x53872a,JSON[_0xf325('0x24')](_0x2ce7f2));_0x2ab046(_0x2ce7f2);})['catch'](function(_0x5e14d8){logger[_0xf325('0x15')]('GetSmsQueue',_0x5e14d8[_0xf325('0x17')],_0x53872a);_0x4a794d(_0x43aa7c['error'](0x1f4,_0x5e14d8[_0xf325('0x17')]));});});};exports[_0xf325('0x25')]=function(_0x48ba79){var _0x55b4b0=this;return new Promise(function(_0x40c398,_0x40de48){return db[_0xf325('0x1a')][_0xf325('0x26')]({'raw':_0x48ba79[_0xf325('0x1c')]?_0x48ba79[_0xf325('0x1c')][_0xf325('0x1d')]===undefined?!![]:![]:!![],'where':_0x48ba79[_0xf325('0x1c')]?_0x48ba79['options'][_0xf325('0x1e')]||null:null,'attributes':_0x48ba79['options']?_0x48ba79[_0xf325('0x1c')][_0xf325('0x1f')]||null:null,'include':_0x48ba79['options']?_0x48ba79[_0xf325('0x1c')]['include']?_[_0xf325('0x21')](_0x48ba79['options'][_0xf325('0x22')],function(_0x503625){return{'model':db[_0x503625['model']],'as':_0x503625['as'],'attributes':_0x503625['attributes'],'include':_0x503625['include']?_['map'](_0x503625[_0xf325('0x22')],function(_0x1cb538){return{'model':db[_0x1cb538['model']],'as':_0x1cb538['as'],'attributes':_0x1cb538[_0xf325('0x1f')],'include':_0x1cb538['include']?_[_0xf325('0x21')](_0x1cb538['include'],function(_0x287a93){return{'model':db[_0x287a93[_0xf325('0x23')]],'as':_0x287a93['as'],'attributes':_0x287a93[_0xf325('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf325('0xf')](function(_0x1c2049){logger[_0xf325('0x10')](_0xf325('0x25'),_0x48ba79);logger[_0xf325('0x13')](_0xf325('0x25'),_0x48ba79,JSON[_0xf325('0x24')](_0x1c2049));_0x40c398(_0x1c2049);})['catch'](function(_0x611d93){logger[_0xf325('0x15')]('ShowSmsQueue',_0x611d93[_0xf325('0x17')],_0x48ba79);_0x40de48(_0x55b4b0[_0xf325('0x15')](0x1f4,_0x611d93[_0xf325('0x17')]));});});};
\ No newline at end of file