Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 0be1678..faf9319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac4=['ShowOpenchannelQueue','find','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify'];(function(_0x5dbc03,_0x189a25){var _0x583864=function(_0x249c66){while(--_0x249c66){_0x5dbc03['push'](_0x5dbc03['shift']());}};_0x583864(++_0x189a25);}(_0xdac4,0x105));var _0x4dac=function(_0x5286da,_0x1cfbb1){_0x5286da=_0x5286da-0x0;var _0x15ef39=_0xdac4[_0x5286da];return _0x15ef39;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4dac('0x0'));var BPromise=require(_0x4dac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4dac('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4dac('0x3'));var jayson=require(_0x4dac('0x4'));var client=jayson[_0x4dac('0x5')]['http']({'port':0x232a});config[_0x4dac('0x6')]=_[_0x4dac('0x7')](config['redis'],{'host':_0x4dac('0x8'),'port':0x18eb});var socket=require(_0x4dac('0x9'))(new Redis(config['redis']));require(_0x4dac('0xa'))[_0x4dac('0xb')](socket);function respondWithRpcPromise(_0x534f9c,_0x4771d0,_0x35e40e){return new BPromise(function(_0x12bcfd,_0x29257f){return client[_0x4dac('0xc')](_0x534f9c,_0x35e40e)[_0x4dac('0xd')](function(_0xd2c7f8){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4771d0,_0x4dac('0xe'));logger[_0x4dac('0xf')](_0x4dac('0x10'),_0x4771d0,_0x4dac('0xe'),JSON['stringify'](_0xd2c7f8));if(_0xd2c7f8[_0x4dac('0x11')]){if(_0xd2c7f8[_0x4dac('0x11')]['code']===0x1f4){logger[_0x4dac('0x11')](_0x4dac('0x12'),_0x4771d0,_0xd2c7f8[_0x4dac('0x11')][_0x4dac('0x13')]);return _0x29257f(_0xd2c7f8[_0x4dac('0x11')][_0x4dac('0x13')]);}logger[_0x4dac('0x11')](_0x4dac('0x12'),_0x4771d0,_0xd2c7f8[_0x4dac('0x11')][_0x4dac('0x13')]);return _0x12bcfd(_0xd2c7f8[_0x4dac('0x11')][_0x4dac('0x13')]);}else{logger[_0x4dac('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x4771d0,'request\x20sent');_0x12bcfd(_0xd2c7f8[_0x4dac('0x15')][_0x4dac('0x13')]);}})[_0x4dac('0x16')](function(_0x5596a1){logger['error'](_0x4dac('0x12'),_0x4771d0,_0x5596a1);_0x29257f(_0x5596a1);});});}exports[_0x4dac('0x17')]=function(_0xd1ce53){var _0x4b63d4=this;return new Promise(function(_0x1c2d18,_0x3dced1){return db[_0x4dac('0x18')][_0x4dac('0x19')]({'raw':_0xd1ce53[_0x4dac('0x1a')]?_0xd1ce53[_0x4dac('0x1a')][_0x4dac('0x1b')]===undefined?!![]:![]:!![],'where':_0xd1ce53[_0x4dac('0x1a')]?_0xd1ce53[_0x4dac('0x1a')][_0x4dac('0x1c')]||null:null,'attributes':_0xd1ce53[_0x4dac('0x1a')]?_0xd1ce53['options']['attributes']||null:null,'limit':_0xd1ce53[_0x4dac('0x1a')]?_0xd1ce53['options'][_0x4dac('0x1d')]||null:null,'include':_0xd1ce53['options']?_0xd1ce53[_0x4dac('0x1a')][_0x4dac('0x1e')]?_[_0x4dac('0x1f')](_0xd1ce53[_0x4dac('0x1a')][_0x4dac('0x1e')],function(_0x16b728){return{'model':db[_0x16b728[_0x4dac('0x20')]],'as':_0x16b728['as'],'attributes':_0x16b728[_0x4dac('0x21')],'include':_0x16b728[_0x4dac('0x1e')]?_['map'](_0x16b728[_0x4dac('0x1e')],function(_0x3a86c9){return{'model':db[_0x3a86c9[_0x4dac('0x20')]],'as':_0x3a86c9['as'],'attributes':_0x3a86c9[_0x4dac('0x21')],'include':_0x3a86c9[_0x4dac('0x1e')]?_[_0x4dac('0x1f')](_0x3a86c9[_0x4dac('0x1e')],function(_0x9fa610){return{'model':db[_0x9fa610['model']],'as':_0x9fa610['as'],'attributes':_0x9fa610[_0x4dac('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4dac('0xd')](function(_0x39fd5f){logger[_0x4dac('0x14')](_0x4dac('0x17'),_0xd1ce53);logger[_0x4dac('0xf')](_0x4dac('0x17'),_0xd1ce53,JSON[_0x4dac('0x22')](_0x39fd5f));_0x1c2d18(_0x39fd5f);})[_0x4dac('0x16')](function(_0x244478){logger[_0x4dac('0x11')](_0x4dac('0x17'),_0x244478[_0x4dac('0x13')],_0xd1ce53);_0x3dced1(_0x4b63d4[_0x4dac('0x11')](0x1f4,_0x244478[_0x4dac('0x13')]));});});};exports[_0x4dac('0x23')]=function(_0x51928c){var _0x14bab4=this;return new Promise(function(_0x246060,_0x3be814){return db[_0x4dac('0x18')][_0x4dac('0x24')]({'raw':_0x51928c[_0x4dac('0x1a')]?_0x51928c['options']['raw']===undefined?!![]:![]:!![],'where':_0x51928c[_0x4dac('0x1a')]?_0x51928c[_0x4dac('0x1a')][_0x4dac('0x1c')]||null:null,'attributes':_0x51928c[_0x4dac('0x1a')]?_0x51928c[_0x4dac('0x1a')][_0x4dac('0x21')]||null:null,'include':_0x51928c[_0x4dac('0x1a')]?_0x51928c[_0x4dac('0x1a')][_0x4dac('0x1e')]?_[_0x4dac('0x1f')](_0x51928c[_0x4dac('0x1a')][_0x4dac('0x1e')],function(_0x4a8329){return{'model':db[_0x4a8329[_0x4dac('0x20')]],'as':_0x4a8329['as'],'attributes':_0x4a8329[_0x4dac('0x21')],'include':_0x4a8329[_0x4dac('0x1e')]?_[_0x4dac('0x1f')](_0x4a8329[_0x4dac('0x1e')],function(_0x1d9656){return{'model':db[_0x1d9656['model']],'as':_0x1d9656['as'],'attributes':_0x1d9656[_0x4dac('0x21')],'include':_0x1d9656[_0x4dac('0x1e')]?_['map'](_0x1d9656[_0x4dac('0x1e')],function(_0x9dc17e){return{'model':db[_0x9dc17e[_0x4dac('0x20')]],'as':_0x9dc17e['as'],'attributes':_0x9dc17e[_0x4dac('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4dac('0xd')](function(_0x38cb9e){logger[_0x4dac('0x14')](_0x4dac('0x23'),_0x51928c);logger['debug'](_0x4dac('0x23'),_0x51928c,JSON[_0x4dac('0x22')](_0x38cb9e));_0x246060(_0x38cb9e);})['catch'](function(_0x26cfc7){logger[_0x4dac('0x11')]('ShowOpenchannelQueue',_0x26cfc7[_0x4dac('0x13')],_0x51928c);_0x3be814(_0x14bab4[_0x4dac('0x11')](0x1f4,_0x26cfc7['message']));});});};
\ No newline at end of file
+var _0xd11c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','raw','where','options','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find'];(function(_0x5ed789,_0x1c99cf){var _0x2c07d8=function(_0x4d73a7){while(--_0x4d73a7){_0x5ed789['push'](_0x5ed789['shift']());}};_0x2c07d8(++_0x1c99cf);}(_0xd11c,0x197));var _0xcd11=function(_0x3b481b,_0x4b0e9a){_0x3b481b=_0x3b481b-0x0;var _0x156c5d=_0xd11c[_0x3b481b];return _0x156c5d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd11('0x0'));var BPromise=require(_0xcd11('0x1'));var rs=require(_0xcd11('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd11('0x3'))['db'];var utils=require(_0xcd11('0x4'));var logger=require(_0xcd11('0x5'))(_0xcd11('0x6'));var config=require(_0xcd11('0x7'));var jayson=require(_0xcd11('0x8'));var client=jayson['client'][_0xcd11('0x9')]({'port':0x232a});config[_0xcd11('0xa')]=_[_0xcd11('0xb')](config['redis'],{'host':_0xcd11('0xc'),'port':0x18eb});var socket=require(_0xcd11('0xd'))(new Redis(config[_0xcd11('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2cd3de,_0x11970a,_0xa608af){return new BPromise(function(_0x546e75,_0x5c6f66){return client['request'](_0x2cd3de,_0xa608af)[_0xcd11('0xe')](function(_0x463952){logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,_0xcd11('0x10'));logger[_0xcd11('0x11')](_0xcd11('0x12'),_0x11970a,_0xcd11('0x10'),JSON[_0xcd11('0x13')](_0x463952));if(_0x463952['error']){if(_0x463952['error'][_0xcd11('0x14')]===0x1f4){logger[_0xcd11('0x15')](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x5c6f66(_0x463952[_0xcd11('0x15')]['message']);}logger['error'](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x546e75(_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);}else{logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,'request\x20sent');_0x546e75(_0x463952['result'][_0xcd11('0x17')]);}})[_0xcd11('0x18')](function(_0x67ef8a){logger['error'](_0xcd11('0x16'),_0x11970a,_0x67ef8a);_0x5c6f66(_0x67ef8a);});});}exports['GetOpenchannelQueue']=function(_0x327f3c){var _0xd5a744=this;return new Promise(function(_0x1e3679,_0xebd785){return db[_0xcd11('0x19')]['findAll']({'raw':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1b')]||null:null,'attributes':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'limit':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1e')]||null:null,'include':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')],function(_0x1acaf8){return{'model':db[_0x1acaf8[_0xcd11('0x21')]],'as':_0x1acaf8['as'],'attributes':_0x1acaf8[_0xcd11('0x1d')],'include':_0x1acaf8['include']?_['map'](_0x1acaf8[_0xcd11('0x1f')],function(_0xde8cb6){return{'model':db[_0xde8cb6[_0xcd11('0x21')]],'as':_0xde8cb6['as'],'attributes':_0xde8cb6[_0xcd11('0x1d')],'include':_0xde8cb6[_0xcd11('0x1f')]?_['map'](_0xde8cb6[_0xcd11('0x1f')],function(_0x4f74ad){return{'model':db[_0x4f74ad[_0xcd11('0x21')]],'as':_0x4f74ad['as'],'attributes':_0x4f74ad[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2fc643){logger[_0xcd11('0xf')](_0xcd11('0x22'),_0x327f3c);logger[_0xcd11('0x11')](_0xcd11('0x22'),_0x327f3c,JSON[_0xcd11('0x13')](_0x2fc643));_0x1e3679(_0x2fc643);})['catch'](function(_0x5b414f){logger[_0xcd11('0x15')]('GetOpenchannelQueue',_0x5b414f['message'],_0x327f3c);_0xebd785(_0xd5a744[_0xcd11('0x15')](0x1f4,_0x5b414f[_0xcd11('0x17')]));});});};exports[_0xcd11('0x23')]=function(_0x2c9724){var _0x3ddf9e=this;return new Promise(function(_0x22da5e,_0x27957d){return db[_0xcd11('0x19')][_0xcd11('0x24')]({'raw':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1b')]||null:null,'attributes':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'include':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x2c9724['options'][_0xcd11('0x1f')],function(_0x10b26b){return{'model':db[_0x10b26b[_0xcd11('0x21')]],'as':_0x10b26b['as'],'attributes':_0x10b26b[_0xcd11('0x1d')],'include':_0x10b26b[_0xcd11('0x1f')]?_['map'](_0x10b26b[_0xcd11('0x1f')],function(_0x5b8e6d){return{'model':db[_0x5b8e6d[_0xcd11('0x21')]],'as':_0x5b8e6d['as'],'attributes':_0x5b8e6d[_0xcd11('0x1d')],'include':_0x5b8e6d['include']?_[_0xcd11('0x20')](_0x5b8e6d[_0xcd11('0x1f')],function(_0x191571){return{'model':db[_0x191571[_0xcd11('0x21')]],'as':_0x191571['as'],'attributes':_0x191571[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2308c8){logger[_0xcd11('0xf')](_0xcd11('0x23'),_0x2c9724);logger['debug']('ShowOpenchannelQueue',_0x2c9724,JSON[_0xcd11('0x13')](_0x2308c8));_0x22da5e(_0x2308c8);})[_0xcd11('0x18')](function(_0x3f4904){logger[_0xcd11('0x15')](_0xcd11('0x23'),_0x3f4904['message'],_0x2c9724);_0x27957d(_0x3ddf9e['error'](0x1f4,_0x3f4904[_0xcd11('0x17')]));});});};
\ No newline at end of file