Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 415cfb4..6dc124b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44b6=['message','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','include','map','model','then','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x17e508,_0x50dc87){var _0x4e96c3=function(_0x556fa7){while(--_0x556fa7){_0x17e508['push'](_0x17e508['shift']());}};_0x4e96c3(++_0x50dc87);}(_0x44b6,0x180));var _0x644b=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x44b6[_0x260f28];return _0x3aefcc;};'use strict';var _=require(_0x644b('0x0'));var util=require(_0x644b('0x1'));var moment=require(_0x644b('0x2'));var BPromise=require(_0x644b('0x3'));var rs=require(_0x644b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x644b('0x5'))['db'];var utils=require(_0x644b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x644b('0x7'));var jayson=require(_0x644b('0x8'));var client=jayson[_0x644b('0x9')]['http']({'port':0x232a});config[_0x644b('0xa')]=_['defaults'](config[_0x644b('0xa')],{'host':_0x644b('0xb'),'port':0x18eb});var socket=require(_0x644b('0xc'))(new Redis(config[_0x644b('0xa')]));require(_0x644b('0xd'))[_0x644b('0xe')](socket);function respondWithRpcPromise(_0x53a626,_0x50afd9,_0x377ddb){return new BPromise(function(_0x11f3fd,_0x47b77c){return client[_0x644b('0xf')](_0x53a626,_0x377ddb)['then'](function(_0x1c3f43){logger[_0x644b('0x10')](_0x644b('0x11'),_0x50afd9,'request\x20sent');logger[_0x644b('0x12')](_0x644b('0x13'),_0x50afd9,_0x644b('0x14'),JSON[_0x644b('0x15')](_0x1c3f43));if(_0x1c3f43[_0x644b('0x16')]){if(_0x1c3f43['error']['code']===0x1f4){logger[_0x644b('0x16')]('SmsQueue,\x20%s,\x20%s',_0x50afd9,_0x1c3f43[_0x644b('0x16')][_0x644b('0x17')]);return _0x47b77c(_0x1c3f43[_0x644b('0x16')][_0x644b('0x17')]);}logger[_0x644b('0x16')](_0x644b('0x11'),_0x50afd9,_0x1c3f43['error'][_0x644b('0x17')]);return _0x11f3fd(_0x1c3f43[_0x644b('0x16')][_0x644b('0x17')]);}else{logger[_0x644b('0x10')](_0x644b('0x11'),_0x50afd9,_0x644b('0x14'));_0x11f3fd(_0x1c3f43['result'][_0x644b('0x17')]);}})[_0x644b('0x18')](function(_0x40169c){logger[_0x644b('0x16')](_0x644b('0x11'),_0x50afd9,_0x40169c);_0x47b77c(_0x40169c);});});}exports[_0x644b('0x19')]=function(_0x5cd0c1){var _0x5b5849=this;return new Promise(function(_0x2233fb,_0x5a633d){return db[_0x644b('0x1a')]['findAll']({'raw':_0x5cd0c1['options']?_0x5cd0c1[_0x644b('0x1b')][_0x644b('0x1c')]===undefined?!![]:![]:!![],'where':_0x5cd0c1[_0x644b('0x1b')]?_0x5cd0c1[_0x644b('0x1b')][_0x644b('0x1d')]||null:null,'attributes':_0x5cd0c1[_0x644b('0x1b')]?_0x5cd0c1[_0x644b('0x1b')][_0x644b('0x1e')]||null:null,'limit':_0x5cd0c1['options']?_0x5cd0c1[_0x644b('0x1b')]['limit']||null:null,'include':_0x5cd0c1[_0x644b('0x1b')]?_0x5cd0c1[_0x644b('0x1b')][_0x644b('0x1f')]?_[_0x644b('0x20')](_0x5cd0c1[_0x644b('0x1b')]['include'],function(_0x49d72a){return{'model':db[_0x49d72a[_0x644b('0x21')]],'as':_0x49d72a['as'],'attributes':_0x49d72a[_0x644b('0x1e')],'include':_0x49d72a[_0x644b('0x1f')]?_[_0x644b('0x20')](_0x49d72a[_0x644b('0x1f')],function(_0x5560e9){return{'model':db[_0x5560e9[_0x644b('0x21')]],'as':_0x5560e9['as'],'attributes':_0x5560e9[_0x644b('0x1e')],'include':_0x5560e9['include']?_[_0x644b('0x20')](_0x5560e9[_0x644b('0x1f')],function(_0x1a3932){return{'model':db[_0x1a3932[_0x644b('0x21')]],'as':_0x1a3932['as'],'attributes':_0x1a3932['attributes']};}):[]};}):[]};}):[]:[]})[_0x644b('0x22')](function(_0xb6e8e3){logger[_0x644b('0x10')](_0x644b('0x19'),_0x5cd0c1);logger['debug']('GetSmsQueue',_0x5cd0c1,JSON[_0x644b('0x15')](_0xb6e8e3));_0x2233fb(_0xb6e8e3);})[_0x644b('0x18')](function(_0x40dd6f){logger[_0x644b('0x16')](_0x644b('0x19'),_0x40dd6f['message'],_0x5cd0c1);_0x5a633d(_0x5b5849['error'](0x1f4,_0x40dd6f[_0x644b('0x17')]));});});};exports['ShowSmsQueue']=function(_0x3efa92){var _0x13eef3=this;return new Promise(function(_0x308051,_0x287254){return db[_0x644b('0x1a')][_0x644b('0x23')]({'raw':_0x3efa92[_0x644b('0x1b')]?_0x3efa92[_0x644b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3efa92[_0x644b('0x1b')]?_0x3efa92[_0x644b('0x1b')][_0x644b('0x1d')]||null:null,'attributes':_0x3efa92[_0x644b('0x1b')]?_0x3efa92[_0x644b('0x1b')][_0x644b('0x1e')]||null:null,'include':_0x3efa92[_0x644b('0x1b')]?_0x3efa92[_0x644b('0x1b')][_0x644b('0x1f')]?_[_0x644b('0x20')](_0x3efa92['options'][_0x644b('0x1f')],function(_0x5592fb){return{'model':db[_0x5592fb['model']],'as':_0x5592fb['as'],'attributes':_0x5592fb[_0x644b('0x1e')],'include':_0x5592fb['include']?_[_0x644b('0x20')](_0x5592fb[_0x644b('0x1f')],function(_0x5d10f3){return{'model':db[_0x5d10f3['model']],'as':_0x5d10f3['as'],'attributes':_0x5d10f3[_0x644b('0x1e')],'include':_0x5d10f3['include']?_['map'](_0x5d10f3[_0x644b('0x1f')],function(_0x2ba5a0){return{'model':db[_0x2ba5a0[_0x644b('0x21')]],'as':_0x2ba5a0['as'],'attributes':_0x2ba5a0[_0x644b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x644b('0x22')](function(_0xefc6d){logger[_0x644b('0x10')](_0x644b('0x24'),_0x3efa92);logger[_0x644b('0x12')](_0x644b('0x24'),_0x3efa92,JSON['stringify'](_0xefc6d));_0x308051(_0xefc6d);})[_0x644b('0x18')](function(_0x1f985e){logger[_0x644b('0x16')](_0x644b('0x24'),_0x1f985e['message'],_0x3efa92);_0x287254(_0x13eef3[_0x644b('0x16')](0x1f4,_0x1f985e['message']));});});};
\ No newline at end of file
+var _0xafc5=['ioredis','../../mysqldb','../../config/logger','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','findAll','options','attributes','limit','include','model','map','catch','ShowSmsQueue','raw','util','moment','bluebird','randomstring'];(function(_0x5a1e9e,_0x40e663){var _0x26ece2=function(_0x31c4f6){while(--_0x31c4f6){_0x5a1e9e['push'](_0x5a1e9e['shift']());}};_0x26ece2(++_0x40e663);}(_0xafc5,0x84));var _0x5afc=function(_0x871039,_0x21ec60){_0x871039=_0x871039-0x0;var _0x4d66b8=_0xafc5[_0x871039];return _0x4d66b8;};'use strict';var _=require('lodash');var util=require(_0x5afc('0x0'));var moment=require(_0x5afc('0x1'));var BPromise=require(_0x5afc('0x2'));var rs=require(_0x5afc('0x3'));var fs=require('fs');var Redis=require(_0x5afc('0x4'));var db=require(_0x5afc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5afc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5afc('0x7')]({'port':0x232a});config[_0x5afc('0x8')]=_[_0x5afc('0x9')](config['redis'],{'host':_0x5afc('0xa'),'port':0x18eb});var socket=require(_0x5afc('0xb'))(new Redis(config[_0x5afc('0x8')]));require(_0x5afc('0xc'))['register'](socket);function respondWithRpcPromise(_0x322a23,_0x4a5f6a,_0x462432){return new BPromise(function(_0x20d52a,_0x21bc81){return client['request'](_0x322a23,_0x462432)[_0x5afc('0xd')](function(_0x15c62b){logger[_0x5afc('0xe')]('SmsQueue,\x20%s,\x20%s',_0x4a5f6a,_0x5afc('0xf'));logger['debug'](_0x5afc('0x10'),_0x4a5f6a,_0x5afc('0xf'),JSON[_0x5afc('0x11')](_0x15c62b));if(_0x15c62b[_0x5afc('0x12')]){if(_0x15c62b[_0x5afc('0x12')]['code']===0x1f4){logger[_0x5afc('0x12')](_0x5afc('0x13'),_0x4a5f6a,_0x15c62b[_0x5afc('0x12')][_0x5afc('0x14')]);return _0x21bc81(_0x15c62b[_0x5afc('0x12')]['message']);}logger[_0x5afc('0x12')](_0x5afc('0x13'),_0x4a5f6a,_0x15c62b[_0x5afc('0x12')]['message']);return _0x20d52a(_0x15c62b['error']['message']);}else{logger['info'](_0x5afc('0x13'),_0x4a5f6a,_0x5afc('0xf'));_0x20d52a(_0x15c62b[_0x5afc('0x15')]['message']);}})['catch'](function(_0x5d2961){logger['error'](_0x5afc('0x13'),_0x4a5f6a,_0x5d2961);_0x21bc81(_0x5d2961);});});}exports[_0x5afc('0x16')]=function(_0x23b1ff){var _0x322f1c=this;return new Promise(function(_0x186b63,_0x96e870){return db[_0x5afc('0x17')][_0x5afc('0x18')]({'raw':_0x23b1ff['options']?_0x23b1ff[_0x5afc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x23b1ff['options']?_0x23b1ff[_0x5afc('0x19')]['where']||null:null,'attributes':_0x23b1ff[_0x5afc('0x19')]?_0x23b1ff['options'][_0x5afc('0x1a')]||null:null,'limit':_0x23b1ff[_0x5afc('0x19')]?_0x23b1ff[_0x5afc('0x19')][_0x5afc('0x1b')]||null:null,'include':_0x23b1ff['options']?_0x23b1ff[_0x5afc('0x19')]['include']?_['map'](_0x23b1ff['options'][_0x5afc('0x1c')],function(_0x14068d){return{'model':db[_0x14068d[_0x5afc('0x1d')]],'as':_0x14068d['as'],'attributes':_0x14068d[_0x5afc('0x1a')],'include':_0x14068d[_0x5afc('0x1c')]?_[_0x5afc('0x1e')](_0x14068d['include'],function(_0x13fe45){return{'model':db[_0x13fe45[_0x5afc('0x1d')]],'as':_0x13fe45['as'],'attributes':_0x13fe45[_0x5afc('0x1a')],'include':_0x13fe45['include']?_[_0x5afc('0x1e')](_0x13fe45[_0x5afc('0x1c')],function(_0x1d9cb4){return{'model':db[_0x1d9cb4[_0x5afc('0x1d')]],'as':_0x1d9cb4['as'],'attributes':_0x1d9cb4[_0x5afc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5afc('0xd')](function(_0x3816ea){logger[_0x5afc('0xe')](_0x5afc('0x16'),_0x23b1ff);logger['debug']('GetSmsQueue',_0x23b1ff,JSON[_0x5afc('0x11')](_0x3816ea));_0x186b63(_0x3816ea);})[_0x5afc('0x1f')](function(_0x5850bb){logger['error'](_0x5afc('0x16'),_0x5850bb['message'],_0x23b1ff);_0x96e870(_0x322f1c[_0x5afc('0x12')](0x1f4,_0x5850bb['message']));});});};exports[_0x5afc('0x20')]=function(_0x461761){var _0xfb7284=this;return new Promise(function(_0x1fb229,_0x22d184){return db['SmsQueue']['find']({'raw':_0x461761['options']?_0x461761[_0x5afc('0x19')][_0x5afc('0x21')]===undefined?!![]:![]:!![],'where':_0x461761[_0x5afc('0x19')]?_0x461761['options']['where']||null:null,'attributes':_0x461761['options']?_0x461761['options']['attributes']||null:null,'include':_0x461761['options']?_0x461761[_0x5afc('0x19')][_0x5afc('0x1c')]?_[_0x5afc('0x1e')](_0x461761['options'][_0x5afc('0x1c')],function(_0x4d0002){return{'model':db[_0x4d0002[_0x5afc('0x1d')]],'as':_0x4d0002['as'],'attributes':_0x4d0002[_0x5afc('0x1a')],'include':_0x4d0002[_0x5afc('0x1c')]?_[_0x5afc('0x1e')](_0x4d0002[_0x5afc('0x1c')],function(_0x484dcf){return{'model':db[_0x484dcf[_0x5afc('0x1d')]],'as':_0x484dcf['as'],'attributes':_0x484dcf[_0x5afc('0x1a')],'include':_0x484dcf[_0x5afc('0x1c')]?_['map'](_0x484dcf['include'],function(_0x913a6e){return{'model':db[_0x913a6e[_0x5afc('0x1d')]],'as':_0x913a6e['as'],'attributes':_0x913a6e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5afc('0xd')](function(_0x138ce9){logger['info'](_0x5afc('0x20'),_0x461761);logger['debug'](_0x5afc('0x20'),_0x461761,JSON[_0x5afc('0x11')](_0x138ce9));_0x1fb229(_0x138ce9);})[_0x5afc('0x1f')](function(_0x29b1a8){logger[_0x5afc('0x12')](_0x5afc('0x20'),_0x29b1a8[_0x5afc('0x14')],_0x461761);_0x22d184(_0xfb7284[_0x5afc('0x12')](0x1f4,_0x29b1a8[_0x5afc('0x14')]));});});};
\ No newline at end of file