Built motion from commit 1efd3d96.|2.6.31
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index ef40eae..5a30775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x397a=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueue','options','where','attributes','limit','include','model','map','then','GetOpenchannelQueue','ShowOpenchannelQueue','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x397a,0x19e));var _0xa397=function(_0x1bc929,_0xc9a46a){_0x1bc929=_0x1bc929-0x0;var _0x2cec33=_0x397a[_0x1bc929];return _0x2cec33;};'use strict';var _=require('lodash');var util=require(_0xa397('0x0'));var moment=require(_0xa397('0x1'));var BPromise=require(_0xa397('0x2'));var rs=require(_0xa397('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa397('0x4'))['db'];var utils=require(_0xa397('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa397('0x6'));var jayson=require(_0xa397('0x7'));var client=jayson[_0xa397('0x8')]['http']({'port':0x232a});config[_0xa397('0x9')]=_[_0xa397('0xa')](config['redis'],{'host':_0xa397('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa397('0xc'))[_0xa397('0xd')](socket);function respondWithRpcPromise(_0x48f6c2,_0x2b9b0d,_0x4b174f){return new BPromise(function(_0x4500d3,_0x8908c5){return client['request'](_0x48f6c2,_0x4b174f)['then'](function(_0x4642a0){logger[_0xa397('0xe')](_0xa397('0xf'),_0x2b9b0d,_0xa397('0x10'));logger[_0xa397('0x11')](_0xa397('0x12'),_0x2b9b0d,_0xa397('0x10'),JSON[_0xa397('0x13')](_0x4642a0));if(_0x4642a0['error']){if(_0x4642a0[_0xa397('0x14')][_0xa397('0x15')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2b9b0d,_0x4642a0[_0xa397('0x14')][_0xa397('0x16')]);return _0x8908c5(_0x4642a0['error'][_0xa397('0x16')]);}logger['error'](_0xa397('0xf'),_0x2b9b0d,_0x4642a0['error'][_0xa397('0x16')]);return _0x4500d3(_0x4642a0[_0xa397('0x14')][_0xa397('0x16')]);}else{logger[_0xa397('0xe')](_0xa397('0xf'),_0x2b9b0d,_0xa397('0x10'));_0x4500d3(_0x4642a0['result'][_0xa397('0x16')]);}})[_0xa397('0x17')](function(_0x5c4e7a){logger['error'](_0xa397('0xf'),_0x2b9b0d,_0x5c4e7a);_0x8908c5(_0x5c4e7a);});});}exports['GetOpenchannelQueue']=function(_0x2632af){var _0x2499e4=this;return new Promise(function(_0x431b7c,_0x136a16){return db[_0xa397('0x18')]['findAll']({'raw':_0x2632af[_0xa397('0x19')]?_0x2632af['options']['raw']===undefined?!![]:![]:!![],'where':_0x2632af[_0xa397('0x19')]?_0x2632af[_0xa397('0x19')][_0xa397('0x1a')]||null:null,'attributes':_0x2632af[_0xa397('0x19')]?_0x2632af['options'][_0xa397('0x1b')]||null:null,'limit':_0x2632af['options']?_0x2632af['options'][_0xa397('0x1c')]||null:null,'include':_0x2632af[_0xa397('0x19')]?_0x2632af['options'][_0xa397('0x1d')]?_['map'](_0x2632af[_0xa397('0x19')][_0xa397('0x1d')],function(_0x2d90d4){return{'model':db[_0x2d90d4[_0xa397('0x1e')]],'as':_0x2d90d4['as'],'attributes':_0x2d90d4['attributes'],'include':_0x2d90d4[_0xa397('0x1d')]?_[_0xa397('0x1f')](_0x2d90d4['include'],function(_0x3f8c8f){return{'model':db[_0x3f8c8f[_0xa397('0x1e')]],'as':_0x3f8c8f['as'],'attributes':_0x3f8c8f[_0xa397('0x1b')],'include':_0x3f8c8f[_0xa397('0x1d')]?_['map'](_0x3f8c8f[_0xa397('0x1d')],function(_0x4c55a8){return{'model':db[_0x4c55a8[_0xa397('0x1e')]],'as':_0x4c55a8['as'],'attributes':_0x4c55a8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa397('0x20')](function(_0x3a2951){logger[_0xa397('0xe')](_0xa397('0x21'),_0x2632af);logger['debug'](_0xa397('0x21'),_0x2632af,JSON['stringify'](_0x3a2951));_0x431b7c(_0x3a2951);})[_0xa397('0x17')](function(_0x30542c){logger[_0xa397('0x14')](_0xa397('0x21'),_0x30542c['message'],_0x2632af);_0x136a16(_0x2499e4['error'](0x1f4,_0x30542c[_0xa397('0x16')]));});});};exports[_0xa397('0x22')]=function(_0x31e701){var _0x56d38e=this;return new Promise(function(_0x1861eb,_0x39dcec){return db[_0xa397('0x18')]['find']({'raw':_0x31e701[_0xa397('0x19')]?_0x31e701[_0xa397('0x19')][_0xa397('0x23')]===undefined?!![]:![]:!![],'where':_0x31e701['options']?_0x31e701[_0xa397('0x19')]['where']||null:null,'attributes':_0x31e701[_0xa397('0x19')]?_0x31e701[_0xa397('0x19')][_0xa397('0x1b')]||null:null,'include':_0x31e701[_0xa397('0x19')]?_0x31e701[_0xa397('0x19')]['include']?_[_0xa397('0x1f')](_0x31e701[_0xa397('0x19')][_0xa397('0x1d')],function(_0x5bbe40){return{'model':db[_0x5bbe40[_0xa397('0x1e')]],'as':_0x5bbe40['as'],'attributes':_0x5bbe40[_0xa397('0x1b')],'include':_0x5bbe40['include']?_[_0xa397('0x1f')](_0x5bbe40[_0xa397('0x1d')],function(_0x5ef50c){return{'model':db[_0x5ef50c[_0xa397('0x1e')]],'as':_0x5ef50c['as'],'attributes':_0x5ef50c[_0xa397('0x1b')],'include':_0x5ef50c['include']?_[_0xa397('0x1f')](_0x5ef50c[_0xa397('0x1d')],function(_0xdda6e2){return{'model':db[_0xdda6e2['model']],'as':_0xdda6e2['as'],'attributes':_0xdda6e2[_0xa397('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa397('0x20')](function(_0x532364){logger[_0xa397('0xe')](_0xa397('0x22'),_0x31e701);logger[_0xa397('0x11')](_0xa397('0x22'),_0x31e701,JSON['stringify'](_0x532364));_0x1861eb(_0x532364);})[_0xa397('0x17')](function(_0x1f8a5b){logger[_0xa397('0x14')](_0xa397('0x22'),_0x1f8a5b['message'],_0x31e701);_0x39dcec(_0x56d38e[_0xa397('0x14')](0x1f4,_0x1f8a5b[_0xa397('0x16')]));});});};
\ No newline at end of file
+var _0x6ac9=['localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','map','model','include','debug','ShowOpenchannelQueue','find','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x2bda97,_0x5011a1){var _0x15bb2b=function(_0x170ee1){while(--_0x170ee1){_0x2bda97['push'](_0x2bda97['shift']());}};_0x15bb2b(++_0x5011a1);}(_0x6ac9,0x1a2));var _0x96ac=function(_0x3c0b0f,_0x14f847){_0x3c0b0f=_0x3c0b0f-0x0;var _0x4bf6a0=_0x6ac9[_0x3c0b0f];return _0x4bf6a0;};'use strict';var _=require('lodash');var util=require(_0x96ac('0x0'));var moment=require(_0x96ac('0x1'));var BPromise=require(_0x96ac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96ac('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x96ac('0x4'));var config=require(_0x96ac('0x5'));var jayson=require(_0x96ac('0x6'));var client=jayson[_0x96ac('0x7')][_0x96ac('0x8')]({'port':0x232a});config[_0x96ac('0x9')]=_[_0x96ac('0xa')](config[_0x96ac('0x9')],{'host':_0x96ac('0xb'),'port':0x18eb});var socket=require(_0x96ac('0xc'))(new Redis(config[_0x96ac('0x9')]));require(_0x96ac('0xd'))[_0x96ac('0xe')](socket);function respondWithRpcPromise(_0x3739df,_0x2a21ac,_0x3156c0){return new BPromise(function(_0x4c22ee,_0x260910){return client['request'](_0x3739df,_0x3156c0)[_0x96ac('0xf')](function(_0x1dc07b){logger[_0x96ac('0x10')](_0x96ac('0x11'),_0x2a21ac,'request\x20sent');logger['debug'](_0x96ac('0x12'),_0x2a21ac,_0x96ac('0x13'),JSON[_0x96ac('0x14')](_0x1dc07b));if(_0x1dc07b[_0x96ac('0x15')]){if(_0x1dc07b[_0x96ac('0x15')][_0x96ac('0x16')]===0x1f4){logger[_0x96ac('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x2a21ac,_0x1dc07b[_0x96ac('0x15')][_0x96ac('0x17')]);return _0x260910(_0x1dc07b[_0x96ac('0x15')][_0x96ac('0x17')]);}logger['error'](_0x96ac('0x11'),_0x2a21ac,_0x1dc07b[_0x96ac('0x15')][_0x96ac('0x17')]);return _0x4c22ee(_0x1dc07b[_0x96ac('0x15')][_0x96ac('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x2a21ac,_0x96ac('0x13'));_0x4c22ee(_0x1dc07b[_0x96ac('0x18')][_0x96ac('0x17')]);}})[_0x96ac('0x19')](function(_0x10c7c9){logger[_0x96ac('0x15')](_0x96ac('0x11'),_0x2a21ac,_0x10c7c9);_0x260910(_0x10c7c9);});});}exports[_0x96ac('0x1a')]=function(_0x4088b4){var _0x219e0f=this;return new Promise(function(_0x5ab255,_0x27877b){return db[_0x96ac('0x1b')][_0x96ac('0x1c')]({'raw':_0x4088b4[_0x96ac('0x1d')]?_0x4088b4[_0x96ac('0x1d')][_0x96ac('0x1e')]===undefined?!![]:![]:!![],'where':_0x4088b4[_0x96ac('0x1d')]?_0x4088b4[_0x96ac('0x1d')][_0x96ac('0x1f')]||null:null,'attributes':_0x4088b4[_0x96ac('0x1d')]?_0x4088b4[_0x96ac('0x1d')][_0x96ac('0x20')]||null:null,'limit':_0x4088b4[_0x96ac('0x1d')]?_0x4088b4[_0x96ac('0x1d')]['limit']||null:null,'include':_0x4088b4[_0x96ac('0x1d')]?_0x4088b4[_0x96ac('0x1d')]['include']?_[_0x96ac('0x21')](_0x4088b4[_0x96ac('0x1d')]['include'],function(_0x4565be){return{'model':db[_0x4565be[_0x96ac('0x22')]],'as':_0x4565be['as'],'attributes':_0x4565be[_0x96ac('0x20')],'include':_0x4565be['include']?_['map'](_0x4565be[_0x96ac('0x23')],function(_0xa4fccc){return{'model':db[_0xa4fccc['model']],'as':_0xa4fccc['as'],'attributes':_0xa4fccc[_0x96ac('0x20')],'include':_0xa4fccc['include']?_[_0x96ac('0x21')](_0xa4fccc[_0x96ac('0x23')],function(_0x388827){return{'model':db[_0x388827['model']],'as':_0x388827['as'],'attributes':_0x388827[_0x96ac('0x20')]};}):[]};}):[]};}):[]:[]})[_0x96ac('0xf')](function(_0x2bd265){logger[_0x96ac('0x10')](_0x96ac('0x1a'),_0x4088b4);logger[_0x96ac('0x24')]('GetOpenchannelQueue',_0x4088b4,JSON[_0x96ac('0x14')](_0x2bd265));_0x5ab255(_0x2bd265);})['catch'](function(_0x155d98){logger['error'](_0x96ac('0x1a'),_0x155d98[_0x96ac('0x17')],_0x4088b4);_0x27877b(_0x219e0f[_0x96ac('0x15')](0x1f4,_0x155d98[_0x96ac('0x17')]));});});};exports[_0x96ac('0x25')]=function(_0x33e421){var _0x34daf0=this;return new Promise(function(_0x2ae0a8,_0x5e522f){return db['OpenchannelQueue'][_0x96ac('0x26')]({'raw':_0x33e421['options']?_0x33e421['options'][_0x96ac('0x1e')]===undefined?!![]:![]:!![],'where':_0x33e421[_0x96ac('0x1d')]?_0x33e421['options'][_0x96ac('0x1f')]||null:null,'attributes':_0x33e421[_0x96ac('0x1d')]?_0x33e421[_0x96ac('0x1d')]['attributes']||null:null,'include':_0x33e421[_0x96ac('0x1d')]?_0x33e421[_0x96ac('0x1d')][_0x96ac('0x23')]?_[_0x96ac('0x21')](_0x33e421['options'][_0x96ac('0x23')],function(_0x25b3e4){return{'model':db[_0x25b3e4[_0x96ac('0x22')]],'as':_0x25b3e4['as'],'attributes':_0x25b3e4[_0x96ac('0x20')],'include':_0x25b3e4['include']?_[_0x96ac('0x21')](_0x25b3e4[_0x96ac('0x23')],function(_0x43f427){return{'model':db[_0x43f427[_0x96ac('0x22')]],'as':_0x43f427['as'],'attributes':_0x43f427[_0x96ac('0x20')],'include':_0x43f427['include']?_['map'](_0x43f427['include'],function(_0x299a64){return{'model':db[_0x299a64[_0x96ac('0x22')]],'as':_0x299a64['as'],'attributes':_0x299a64[_0x96ac('0x20')]};}):[]};}):[]};}):[]:[]})[_0x96ac('0xf')](function(_0x51eaf4){logger['info'](_0x96ac('0x25'),_0x33e421);logger[_0x96ac('0x24')](_0x96ac('0x25'),_0x33e421,JSON[_0x96ac('0x14')](_0x51eaf4));_0x2ae0a8(_0x51eaf4);})[_0x96ac('0x19')](function(_0x308e64){logger[_0x96ac('0x15')]('ShowOpenchannelQueue',_0x308e64['message'],_0x33e421);_0x5e522f(_0x34daf0[_0x96ac('0x15')](0x1f4,_0x308e64['message']));});});};
\ No newline at end of file