Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index a3c643d..db88674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x870a=['request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowSmsQueue','SmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x870a,0x1c5));var _0xa870=function(_0x3a3e2b,_0x17bceb){_0x3a3e2b=_0x3a3e2b-0x0;var _0x42de39=_0x870a[_0x3a3e2b];return _0x42de39;};'use strict';var _=require(_0xa870('0x0'));var util=require(_0xa870('0x1'));var moment=require(_0xa870('0x2'));var BPromise=require(_0xa870('0x3'));var rs=require(_0xa870('0x4'));var fs=require('fs');var Redis=require(_0xa870('0x5'));var db=require(_0xa870('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa870('0x7'))(_0xa870('0x8'));var config=require(_0xa870('0x9'));var jayson=require(_0xa870('0xa'));var client=jayson[_0xa870('0xb')][_0xa870('0xc')]({'port':0x232a});config[_0xa870('0xd')]=_['defaults'](config[_0xa870('0xd')],{'host':_0xa870('0xe'),'port':0x18eb});var socket=require(_0xa870('0xf'))(new Redis(config[_0xa870('0xd')]));require(_0xa870('0x10'))[_0xa870('0x11')](socket);function respondWithRpcPromise(_0x154339,_0x1e78ac,_0x18013d){return new BPromise(function(_0x4279bc,_0x3c3f88){return client[_0xa870('0x12')](_0x154339,_0x18013d)[_0xa870('0x13')](function(_0x3dc561){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1e78ac,_0xa870('0x14'));logger[_0xa870('0x15')](_0xa870('0x16'),_0x1e78ac,_0xa870('0x14'),JSON['stringify'](_0x3dc561));if(_0x3dc561[_0xa870('0x17')]){if(_0x3dc561[_0xa870('0x17')][_0xa870('0x18')]===0x1f4){logger[_0xa870('0x17')](_0xa870('0x19'),_0x1e78ac,_0x3dc561[_0xa870('0x17')][_0xa870('0x1a')]);return _0x3c3f88(_0x3dc561[_0xa870('0x17')][_0xa870('0x1a')]);}logger[_0xa870('0x17')]('SmsQueue,\x20%s,\x20%s',_0x1e78ac,_0x3dc561['error'][_0xa870('0x1a')]);return _0x4279bc(_0x3dc561[_0xa870('0x17')][_0xa870('0x1a')]);}else{logger[_0xa870('0x1b')](_0xa870('0x19'),_0x1e78ac,_0xa870('0x14'));_0x4279bc(_0x3dc561[_0xa870('0x1c')][_0xa870('0x1a')]);}})[_0xa870('0x1d')](function(_0x1fbf82){logger[_0xa870('0x17')](_0xa870('0x19'),_0x1e78ac,_0x1fbf82);_0x3c3f88(_0x1fbf82);});});}exports[_0xa870('0x1e')]=function(_0x1a5ccc){var _0x4b14a2=this;return new Promise(function(_0x3ff32f,_0x37e2df){return db['SmsQueue'][_0xa870('0x1f')]({'raw':_0x1a5ccc[_0xa870('0x20')]?_0x1a5ccc[_0xa870('0x20')][_0xa870('0x21')]===undefined?!![]:![]:!![],'where':_0x1a5ccc[_0xa870('0x20')]?_0x1a5ccc['options']['where']||null:null,'attributes':_0x1a5ccc[_0xa870('0x20')]?_0x1a5ccc[_0xa870('0x20')][_0xa870('0x22')]||null:null,'limit':_0x1a5ccc[_0xa870('0x20')]?_0x1a5ccc[_0xa870('0x20')][_0xa870('0x23')]||null:null,'include':_0x1a5ccc[_0xa870('0x20')]?_0x1a5ccc['options'][_0xa870('0x24')]?_['map'](_0x1a5ccc[_0xa870('0x20')][_0xa870('0x24')],function(_0x1513cd){return{'model':db[_0x1513cd[_0xa870('0x25')]],'as':_0x1513cd['as'],'attributes':_0x1513cd['attributes'],'include':_0x1513cd[_0xa870('0x24')]?_[_0xa870('0x26')](_0x1513cd['include'],function(_0x3b7a5f){return{'model':db[_0x3b7a5f['model']],'as':_0x3b7a5f['as'],'attributes':_0x3b7a5f['attributes'],'include':_0x3b7a5f[_0xa870('0x24')]?_[_0xa870('0x26')](_0x3b7a5f[_0xa870('0x24')],function(_0x59766a){return{'model':db[_0x59766a[_0xa870('0x25')]],'as':_0x59766a['as'],'attributes':_0x59766a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa870('0x13')](function(_0x3133b7){logger[_0xa870('0x1b')](_0xa870('0x1e'),_0x1a5ccc);logger['debug'](_0xa870('0x1e'),_0x1a5ccc,JSON[_0xa870('0x27')](_0x3133b7));_0x3ff32f(_0x3133b7);})[_0xa870('0x1d')](function(_0x571d21){logger[_0xa870('0x17')](_0xa870('0x1e'),_0x571d21[_0xa870('0x1a')],_0x1a5ccc);_0x37e2df(_0x4b14a2['error'](0x1f4,_0x571d21[_0xa870('0x1a')]));});});};exports[_0xa870('0x28')]=function(_0x500b38){var _0x55dab3=this;return new Promise(function(_0x4769e4,_0x1b540d){return db[_0xa870('0x29')][_0xa870('0x2a')]({'raw':_0x500b38[_0xa870('0x20')]?_0x500b38['options']['raw']===undefined?!![]:![]:!![],'where':_0x500b38[_0xa870('0x20')]?_0x500b38[_0xa870('0x20')]['where']||null:null,'attributes':_0x500b38[_0xa870('0x20')]?_0x500b38['options'][_0xa870('0x22')]||null:null,'include':_0x500b38['options']?_0x500b38[_0xa870('0x20')][_0xa870('0x24')]?_[_0xa870('0x26')](_0x500b38[_0xa870('0x20')]['include'],function(_0x167f79){return{'model':db[_0x167f79[_0xa870('0x25')]],'as':_0x167f79['as'],'attributes':_0x167f79['attributes'],'include':_0x167f79[_0xa870('0x24')]?_[_0xa870('0x26')](_0x167f79[_0xa870('0x24')],function(_0x951ec4){return{'model':db[_0x951ec4[_0xa870('0x25')]],'as':_0x951ec4['as'],'attributes':_0x951ec4['attributes'],'include':_0x951ec4['include']?_['map'](_0x951ec4[_0xa870('0x24')],function(_0x51a33d){return{'model':db[_0x51a33d['model']],'as':_0x51a33d['as'],'attributes':_0x51a33d[_0xa870('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa870('0x13')](function(_0x5f038b){logger[_0xa870('0x1b')]('ShowSmsQueue',_0x500b38);logger[_0xa870('0x15')]('ShowSmsQueue',_0x500b38,JSON[_0xa870('0x27')](_0x5f038b));_0x4769e4(_0x5f038b);})['catch'](function(_0x5d3156){logger[_0xa870('0x17')]('ShowSmsQueue',_0x5d3156[_0xa870('0x1a')],_0x500b38);_0x1b540d(_0x55dab3[_0xa870('0x17')](0x1f4,_0x5d3156['message']));});});};
\ 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