Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 3787281..db88674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464a=['GetSmsQueue','catch','ShowSmsQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','SmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x464a,0x9c));var _0xa464=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x464a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa464('0x0'));var BPromise=require(_0xa464('0x1'));var rs=require(_0xa464('0x2'));var fs=require('fs');var Redis=require(_0xa464('0x3'));var db=require(_0xa464('0x4'))['db'];var utils=require(_0xa464('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa464('0x6'));var client=jayson['client'][_0xa464('0x7')]({'port':0x232a});config['redis']=_[_0xa464('0x8')](config[_0xa464('0x9')],{'host':_0xa464('0xa'),'port':0x18eb});var socket=require(_0xa464('0xb'))(new Redis(config[_0xa464('0x9')]));require('./smsQueue.socket')[_0xa464('0xc')](socket);function respondWithRpcPromise(_0x45aa5a,_0x2d2bf1,_0x3fb3b0){return new BPromise(function(_0x4be191,_0x40e667){return client[_0xa464('0xd')](_0x45aa5a,_0x3fb3b0)['then'](function(_0xab1249){logger[_0xa464('0xe')](_0xa464('0xf'),_0x2d2bf1,_0xa464('0x10'));logger[_0xa464('0x11')](_0xa464('0x12'),_0x2d2bf1,_0xa464('0x10'),JSON['stringify'](_0xab1249));if(_0xab1249[_0xa464('0x13')]){if(_0xab1249[_0xa464('0x13')][_0xa464('0x14')]===0x1f4){logger['error'](_0xa464('0xf'),_0x2d2bf1,_0xab1249[_0xa464('0x13')][_0xa464('0x15')]);return _0x40e667(_0xab1249[_0xa464('0x13')][_0xa464('0x15')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x2d2bf1,_0xab1249['error'][_0xa464('0x15')]);return _0x4be191(_0xab1249[_0xa464('0x13')]['message']);}else{logger[_0xa464('0xe')](_0xa464('0xf'),_0x2d2bf1,_0xa464('0x10'));_0x4be191(_0xab1249[_0xa464('0x16')][_0xa464('0x15')]);}})['catch'](function(_0x1ddef0){logger[_0xa464('0x13')]('SmsQueue,\x20%s,\x20%s',_0x2d2bf1,_0x1ddef0);_0x40e667(_0x1ddef0);});});}exports['GetSmsQueue']=function(_0x391c48){var _0x22945f=this;return new Promise(function(_0x9698ad,_0x5a71cd){return db[_0xa464('0x17')][_0xa464('0x18')]({'raw':_0x391c48[_0xa464('0x19')]?_0x391c48[_0xa464('0x19')][_0xa464('0x1a')]===undefined?!![]:![]:!![],'where':_0x391c48[_0xa464('0x19')]?_0x391c48['options'][_0xa464('0x1b')]||null:null,'attributes':_0x391c48[_0xa464('0x19')]?_0x391c48[_0xa464('0x19')][_0xa464('0x1c')]||null:null,'limit':_0x391c48[_0xa464('0x19')]?_0x391c48['options'][_0xa464('0x1d')]||null:null,'include':_0x391c48[_0xa464('0x19')]?_0x391c48[_0xa464('0x19')][_0xa464('0x1e')]?_[_0xa464('0x1f')](_0x391c48['options'][_0xa464('0x1e')],function(_0x3e0e59){return{'model':db[_0x3e0e59[_0xa464('0x20')]],'as':_0x3e0e59['as'],'attributes':_0x3e0e59['attributes'],'include':_0x3e0e59[_0xa464('0x1e')]?_[_0xa464('0x1f')](_0x3e0e59['include'],function(_0x3bc00f){return{'model':db[_0x3bc00f[_0xa464('0x20')]],'as':_0x3bc00f['as'],'attributes':_0x3bc00f[_0xa464('0x1c')],'include':_0x3bc00f[_0xa464('0x1e')]?_[_0xa464('0x1f')](_0x3bc00f[_0xa464('0x1e')],function(_0x41c74f){return{'model':db[_0x41c74f['model']],'as':_0x41c74f['as'],'attributes':_0x41c74f[_0xa464('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa464('0x21')](function(_0xe32e5b){logger[_0xa464('0xe')](_0xa464('0x22'),_0x391c48);logger[_0xa464('0x11')](_0xa464('0x22'),_0x391c48,JSON['stringify'](_0xe32e5b));_0x9698ad(_0xe32e5b);})[_0xa464('0x23')](function(_0x5898da){logger[_0xa464('0x13')]('GetSmsQueue',_0x5898da[_0xa464('0x15')],_0x391c48);_0x5a71cd(_0x22945f['error'](0x1f4,_0x5898da[_0xa464('0x15')]));});});};exports[_0xa464('0x24')]=function(_0x1bba26){var _0x317766=this;return new Promise(function(_0x53e70d,_0x52d923){return db[_0xa464('0x17')][_0xa464('0x25')]({'raw':_0x1bba26[_0xa464('0x19')]?_0x1bba26[_0xa464('0x19')][_0xa464('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bba26['options']?_0x1bba26[_0xa464('0x19')][_0xa464('0x1b')]||null:null,'attributes':_0x1bba26[_0xa464('0x19')]?_0x1bba26[_0xa464('0x19')][_0xa464('0x1c')]||null:null,'include':_0x1bba26[_0xa464('0x19')]?_0x1bba26[_0xa464('0x19')][_0xa464('0x1e')]?_[_0xa464('0x1f')](_0x1bba26[_0xa464('0x19')]['include'],function(_0x5565c2){return{'model':db[_0x5565c2[_0xa464('0x20')]],'as':_0x5565c2['as'],'attributes':_0x5565c2[_0xa464('0x1c')],'include':_0x5565c2[_0xa464('0x1e')]?_['map'](_0x5565c2[_0xa464('0x1e')],function(_0xcd224f){return{'model':db[_0xcd224f[_0xa464('0x20')]],'as':_0xcd224f['as'],'attributes':_0xcd224f[_0xa464('0x1c')],'include':_0xcd224f[_0xa464('0x1e')]?_[_0xa464('0x1f')](_0xcd224f[_0xa464('0x1e')],function(_0x1d11b9){return{'model':db[_0x1d11b9[_0xa464('0x20')]],'as':_0x1d11b9['as'],'attributes':_0x1d11b9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x226a6b){logger[_0xa464('0xe')](_0xa464('0x24'),_0x1bba26);logger[_0xa464('0x11')](_0xa464('0x24'),_0x1bba26,JSON['stringify'](_0x226a6b));_0x53e70d(_0x226a6b);})[_0xa464('0x23')](function(_0x1f25f0){logger[_0xa464('0x13')](_0xa464('0x24'),_0x1f25f0['message'],_0x1bba26);_0x52d923(_0x317766[_0xa464('0x13')](0x1f4,_0x1f25f0[_0xa464('0x15')]));});});};
\ No newline at end of file
+var _0x7653=['bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsQueue','options','raw','limit','include','map','attributes','model','GetSmsQueue','debug','ShowSmsQueue','where','lodash','moment'];(function(_0x33929f,_0x139567){var _0x299f88=function(_0x10ca1a){while(--_0x10ca1a){_0x33929f['push'](_0x33929f['shift']());}};_0x299f88(++_0x139567);}(_0x7653,0x64));var _0x3765=function(_0x3355,_0x9b2e0f){_0x3355=_0x3355-0x0;var _0x3fcab2=_0x7653[_0x3355];return _0x3fcab2;};'use strict';var _=require(_0x3765('0x0'));var util=require('util');var moment=require(_0x3765('0x1'));var BPromise=require(_0x3765('0x2'));var rs=require(_0x3765('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3765('0x4'));var logger=require(_0x3765('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3765('0x6'));var client=jayson[_0x3765('0x7')][_0x3765('0x8')]({'port':0x232a});config[_0x3765('0x9')]=_[_0x3765('0xa')](config[_0x3765('0x9')],{'host':_0x3765('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3765('0x9')]));require(_0x3765('0xc'))['register'](socket);function respondWithRpcPromise(_0x543048,_0xa71f78,_0x411648){return new BPromise(function(_0x1383d7,_0x31e915){return client['request'](_0x543048,_0x411648)[_0x3765('0xd')](function(_0x1486d1){logger[_0x3765('0xe')](_0x3765('0xf'),_0xa71f78,_0x3765('0x10'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xa71f78,_0x3765('0x10'),JSON[_0x3765('0x11')](_0x1486d1));if(_0x1486d1[_0x3765('0x12')]){if(_0x1486d1['error'][_0x3765('0x13')]===0x1f4){logger[_0x3765('0x12')]('SmsQueue,\x20%s,\x20%s',_0xa71f78,_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);return _0x31e915(_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);}logger[_0x3765('0x12')](_0x3765('0xf'),_0xa71f78,_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);return _0x1383d7(_0x1486d1[_0x3765('0x12')]['message']);}else{logger[_0x3765('0xe')]('SmsQueue,\x20%s,\x20%s',_0xa71f78,_0x3765('0x10'));_0x1383d7(_0x1486d1['result'][_0x3765('0x14')]);}})[_0x3765('0x15')](function(_0x2552cf){logger[_0x3765('0x12')](_0x3765('0xf'),_0xa71f78,_0x2552cf);_0x31e915(_0x2552cf);});});}exports['GetSmsQueue']=function(_0x350e9f){var _0xd1cca9=this;return new Promise(function(_0x2e9e1c,_0x23c67b){return db[_0x3765('0x16')]['findAll']({'raw':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')][_0x3765('0x18')]===undefined?!![]:![]:!![],'where':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')]['where']||null:null,'attributes':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')]['attributes']||null:null,'limit':_0x350e9f['options']?_0x350e9f['options'][_0x3765('0x19')]||null:null,'include':_0x350e9f['options']?_0x350e9f[_0x3765('0x17')][_0x3765('0x1a')]?_[_0x3765('0x1b')](_0x350e9f[_0x3765('0x17')][_0x3765('0x1a')],function(_0x35c401){return{'model':db[_0x35c401['model']],'as':_0x35c401['as'],'attributes':_0x35c401[_0x3765('0x1c')],'include':_0x35c401[_0x3765('0x1a')]?_['map'](_0x35c401[_0x3765('0x1a')],function(_0xcc3375){return{'model':db[_0xcc3375[_0x3765('0x1d')]],'as':_0xcc3375['as'],'attributes':_0xcc3375['attributes'],'include':_0xcc3375[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0xcc3375[_0x3765('0x1a')],function(_0x21b378){return{'model':db[_0x21b378['model']],'as':_0x21b378['as'],'attributes':_0x21b378[_0x3765('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e08fc){logger[_0x3765('0xe')](_0x3765('0x1e'),_0x350e9f);logger[_0x3765('0x1f')](_0x3765('0x1e'),_0x350e9f,JSON[_0x3765('0x11')](_0x2e08fc));_0x2e9e1c(_0x2e08fc);})[_0x3765('0x15')](function(_0x52b222){logger[_0x3765('0x12')](_0x3765('0x1e'),_0x52b222[_0x3765('0x14')],_0x350e9f);_0x23c67b(_0xd1cca9['error'](0x1f4,_0x52b222[_0x3765('0x14')]));});});};exports[_0x3765('0x20')]=function(_0x7f40e4){var _0x43f79f=this;return new Promise(function(_0x102a94,_0x1db412){return db[_0x3765('0x16')]['find']({'raw':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x18')]===undefined?!![]:![]:!![],'where':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x21')]||null:null,'attributes':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x1c')]||null:null,'include':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')]['include']?_[_0x3765('0x1b')](_0x7f40e4['options']['include'],function(_0xd69f07){return{'model':db[_0xd69f07['model']],'as':_0xd69f07['as'],'attributes':_0xd69f07[_0x3765('0x1c')],'include':_0xd69f07[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0xd69f07['include'],function(_0x289805){return{'model':db[_0x289805[_0x3765('0x1d')]],'as':_0x289805['as'],'attributes':_0x289805[_0x3765('0x1c')],'include':_0x289805[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0x289805[_0x3765('0x1a')],function(_0xbaaaee){return{'model':db[_0xbaaaee[_0x3765('0x1d')]],'as':_0xbaaaee['as'],'attributes':_0xbaaaee[_0x3765('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3765('0xd')](function(_0x516458){logger[_0x3765('0xe')]('ShowSmsQueue',_0x7f40e4);logger[_0x3765('0x1f')]('ShowSmsQueue',_0x7f40e4,JSON[_0x3765('0x11')](_0x516458));_0x102a94(_0x516458);})[_0x3765('0x15')](function(_0x37dea0){logger[_0x3765('0x12')](_0x3765('0x20'),_0x37dea0[_0x3765('0x14')],_0x7f40e4);_0x1db412(_0x43f79f['error'](0x1f4,_0x37dea0[_0x3765('0x14')]));});});};
\ No newline at end of file