Built motion from commit b7e79837.|2.6.29
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 520746e..fa39121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16f2=['request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','raw','options','attributes','limit','include','model','map','then','debug','ShowOpenchannelQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','./openchannelQueue.socket','register','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x3705f7,_0x2553c4){var _0x2a1cf2=function(_0x51f080){while(--_0x51f080){_0x3705f7['push'](_0x3705f7['shift']());}};_0x2a1cf2(++_0x2553c4);}(_0x16f2,0x1df));var _0x216f=function(_0x2e1058,_0x535e8c){_0x2e1058=_0x2e1058-0x0;var _0x3b9d5b=_0x16f2[_0x2e1058];return _0x3b9d5b;};'use strict';var _=require('lodash');var util=require(_0x216f('0x0'));var moment=require(_0x216f('0x1'));var BPromise=require(_0x216f('0x2'));var rs=require(_0x216f('0x3'));var fs=require('fs');var Redis=require(_0x216f('0x4'));var db=require(_0x216f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x216f('0x6'))(_0x216f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x216f('0x8')][_0x216f('0x9')]({'port':0x232a});config[_0x216f('0xa')]=_['defaults'](config['redis'],{'host':_0x216f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x216f('0xa')]));require(_0x216f('0xc'))[_0x216f('0xd')](socket);function respondWithRpcPromise(_0x496e48,_0x463c99,_0x18b1b4){return new BPromise(function(_0x330b64,_0x4dc195){return client['request'](_0x496e48,_0x18b1b4)['then'](function(_0xb25840){logger['info'](_0x216f('0xe'),_0x463c99,_0x216f('0xf'));logger['debug'](_0x216f('0x10'),_0x463c99,_0x216f('0xf'),JSON[_0x216f('0x11')](_0xb25840));if(_0xb25840[_0x216f('0x12')]){if(_0xb25840['error'][_0x216f('0x13')]===0x1f4){logger[_0x216f('0x12')](_0x216f('0xe'),_0x463c99,_0xb25840['error'][_0x216f('0x14')]);return _0x4dc195(_0xb25840[_0x216f('0x12')]['message']);}logger[_0x216f('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x463c99,_0xb25840['error'][_0x216f('0x14')]);return _0x330b64(_0xb25840[_0x216f('0x12')][_0x216f('0x14')]);}else{logger[_0x216f('0x15')](_0x216f('0xe'),_0x463c99,'request\x20sent');_0x330b64(_0xb25840[_0x216f('0x16')][_0x216f('0x14')]);}})[_0x216f('0x17')](function(_0x489708){logger[_0x216f('0x12')](_0x216f('0xe'),_0x463c99,_0x489708);_0x4dc195(_0x489708);});});}exports[_0x216f('0x18')]=function(_0x1a6a92){var _0x37b98f=this;return new Promise(function(_0x55c969,_0x54e1d9){return db[_0x216f('0x19')]['findAll']({'raw':_0x1a6a92['options']?_0x1a6a92['options'][_0x216f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a6a92['options']?_0x1a6a92['options']['where']||null:null,'attributes':_0x1a6a92[_0x216f('0x1b')]?_0x1a6a92[_0x216f('0x1b')][_0x216f('0x1c')]||null:null,'limit':_0x1a6a92[_0x216f('0x1b')]?_0x1a6a92['options'][_0x216f('0x1d')]||null:null,'include':_0x1a6a92[_0x216f('0x1b')]?_0x1a6a92[_0x216f('0x1b')][_0x216f('0x1e')]?_['map'](_0x1a6a92[_0x216f('0x1b')][_0x216f('0x1e')],function(_0x58020b){return{'model':db[_0x58020b[_0x216f('0x1f')]],'as':_0x58020b['as'],'attributes':_0x58020b[_0x216f('0x1c')],'include':_0x58020b[_0x216f('0x1e')]?_[_0x216f('0x20')](_0x58020b['include'],function(_0x473a09){return{'model':db[_0x473a09[_0x216f('0x1f')]],'as':_0x473a09['as'],'attributes':_0x473a09[_0x216f('0x1c')],'include':_0x473a09[_0x216f('0x1e')]?_['map'](_0x473a09['include'],function(_0x28487d){return{'model':db[_0x28487d[_0x216f('0x1f')]],'as':_0x28487d['as'],'attributes':_0x28487d['attributes']};}):[]};}):[]};}):[]:[]})[_0x216f('0x21')](function(_0x4bc642){logger[_0x216f('0x15')](_0x216f('0x18'),_0x1a6a92);logger[_0x216f('0x22')]('GetOpenchannelQueue',_0x1a6a92,JSON[_0x216f('0x11')](_0x4bc642));_0x55c969(_0x4bc642);})[_0x216f('0x17')](function(_0x25b4ce){logger[_0x216f('0x12')]('GetOpenchannelQueue',_0x25b4ce['message'],_0x1a6a92);_0x54e1d9(_0x37b98f[_0x216f('0x12')](0x1f4,_0x25b4ce['message']));});});};exports[_0x216f('0x23')]=function(_0x34079b){var _0xbab508=this;return new Promise(function(_0x311f23,_0x29446b){return db[_0x216f('0x19')][_0x216f('0x24')]({'raw':_0x34079b[_0x216f('0x1b')]?_0x34079b[_0x216f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x34079b['options']?_0x34079b['options'][_0x216f('0x25')]||null:null,'attributes':_0x34079b[_0x216f('0x1b')]?_0x34079b['options'][_0x216f('0x1c')]||null:null,'include':_0x34079b[_0x216f('0x1b')]?_0x34079b[_0x216f('0x1b')]['include']?_[_0x216f('0x20')](_0x34079b['options'][_0x216f('0x1e')],function(_0x335663){return{'model':db[_0x335663[_0x216f('0x1f')]],'as':_0x335663['as'],'attributes':_0x335663[_0x216f('0x1c')],'include':_0x335663[_0x216f('0x1e')]?_[_0x216f('0x20')](_0x335663[_0x216f('0x1e')],function(_0x39ced3){return{'model':db[_0x39ced3['model']],'as':_0x39ced3['as'],'attributes':_0x39ced3[_0x216f('0x1c')],'include':_0x39ced3[_0x216f('0x1e')]?_['map'](_0x39ced3[_0x216f('0x1e')],function(_0x72ca61){return{'model':db[_0x72ca61['model']],'as':_0x72ca61['as'],'attributes':_0x72ca61['attributes']};}):[]};}):[]};}):[]:[]})[_0x216f('0x21')](function(_0x476793){logger[_0x216f('0x15')](_0x216f('0x23'),_0x34079b);logger[_0x216f('0x22')](_0x216f('0x23'),_0x34079b,JSON['stringify'](_0x476793));_0x311f23(_0x476793);})[_0x216f('0x17')](function(_0x2d425e){logger[_0x216f('0x12')](_0x216f('0x23'),_0x2d425e['message'],_0x34079b);_0x29446b(_0xbab508['error'](0x1f4,_0x2d425e[_0x216f('0x14')]));});});};
\ No newline at end of file
+var _0x32bf=['model','debug','stringify','GetOpenchannelQueue','ShowOpenchannelQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x3cf78d,_0x3a467a){var _0x35e8d6=function(_0x24dfe1){while(--_0x24dfe1){_0x3cf78d['push'](_0x3cf78d['shift']());}};_0x35e8d6(++_0x3a467a);}(_0x32bf,0x83));var _0xf32b=function(_0x58ad2c,_0x5339f1){_0x58ad2c=_0x58ad2c-0x0;var _0x45346a=_0x32bf[_0x58ad2c];return _0x45346a;};'use strict';var _=require('lodash');var util=require(_0xf32b('0x0'));var moment=require(_0xf32b('0x1'));var BPromise=require(_0xf32b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf32b('0x3'));var db=require(_0xf32b('0x4'))['db'];var utils=require(_0xf32b('0x5'));var logger=require(_0xf32b('0x6'))(_0xf32b('0x7'));var config=require(_0xf32b('0x8'));var jayson=require(_0xf32b('0x9'));var client=jayson[_0xf32b('0xa')][_0xf32b('0xb')]({'port':0x232a});config[_0xf32b('0xc')]=_[_0xf32b('0xd')](config[_0xf32b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf32b('0xe'))(new Redis(config[_0xf32b('0xc')]));require(_0xf32b('0xf'))[_0xf32b('0x10')](socket);function respondWithRpcPromise(_0x5e94ef,_0x5f0463,_0xa58c5f){return new BPromise(function(_0xe80e5a,_0x140af6){return client[_0xf32b('0x11')](_0x5e94ef,_0xa58c5f)[_0xf32b('0x12')](function(_0x46a369){logger['info'](_0xf32b('0x13'),_0x5f0463,_0xf32b('0x14'));logger['debug'](_0xf32b('0x15'),_0x5f0463,'request\x20sent',JSON['stringify'](_0x46a369));if(_0x46a369['error']){if(_0x46a369[_0xf32b('0x16')][_0xf32b('0x17')]===0x1f4){logger['error'](_0xf32b('0x13'),_0x5f0463,_0x46a369['error'][_0xf32b('0x18')]);return _0x140af6(_0x46a369[_0xf32b('0x16')][_0xf32b('0x18')]);}logger[_0xf32b('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x5f0463,_0x46a369[_0xf32b('0x16')]['message']);return _0xe80e5a(_0x46a369[_0xf32b('0x16')][_0xf32b('0x18')]);}else{logger[_0xf32b('0x19')](_0xf32b('0x13'),_0x5f0463,'request\x20sent');_0xe80e5a(_0x46a369[_0xf32b('0x1a')][_0xf32b('0x18')]);}})[_0xf32b('0x1b')](function(_0x59608e){logger[_0xf32b('0x16')](_0xf32b('0x13'),_0x5f0463,_0x59608e);_0x140af6(_0x59608e);});});}exports['GetOpenchannelQueue']=function(_0x3841f7){var _0x3b070b=this;return new Promise(function(_0x2b8b8f,_0x3aa1c1){return db[_0xf32b('0x1c')][_0xf32b('0x1d')]({'raw':_0x3841f7[_0xf32b('0x1e')]?_0x3841f7[_0xf32b('0x1e')][_0xf32b('0x1f')]===undefined?!![]:![]:!![],'where':_0x3841f7[_0xf32b('0x1e')]?_0x3841f7[_0xf32b('0x1e')][_0xf32b('0x20')]||null:null,'attributes':_0x3841f7['options']?_0x3841f7['options'][_0xf32b('0x21')]||null:null,'limit':_0x3841f7[_0xf32b('0x1e')]?_0x3841f7[_0xf32b('0x1e')][_0xf32b('0x22')]||null:null,'include':_0x3841f7[_0xf32b('0x1e')]?_0x3841f7[_0xf32b('0x1e')][_0xf32b('0x23')]?_[_0xf32b('0x24')](_0x3841f7['options'][_0xf32b('0x23')],function(_0x1d3e81){return{'model':db[_0x1d3e81[_0xf32b('0x25')]],'as':_0x1d3e81['as'],'attributes':_0x1d3e81[_0xf32b('0x21')],'include':_0x1d3e81[_0xf32b('0x23')]?_['map'](_0x1d3e81[_0xf32b('0x23')],function(_0x84d909){return{'model':db[_0x84d909['model']],'as':_0x84d909['as'],'attributes':_0x84d909[_0xf32b('0x21')],'include':_0x84d909['include']?_['map'](_0x84d909[_0xf32b('0x23')],function(_0x146c82){return{'model':db[_0x146c82[_0xf32b('0x25')]],'as':_0x146c82['as'],'attributes':_0x146c82['attributes']};}):[]};}):[]};}):[]:[]})[_0xf32b('0x12')](function(_0x110a49){logger[_0xf32b('0x19')]('GetOpenchannelQueue',_0x3841f7);logger[_0xf32b('0x26')]('GetOpenchannelQueue',_0x3841f7,JSON[_0xf32b('0x27')](_0x110a49));_0x2b8b8f(_0x110a49);})[_0xf32b('0x1b')](function(_0x1f3c05){logger[_0xf32b('0x16')](_0xf32b('0x28'),_0x1f3c05[_0xf32b('0x18')],_0x3841f7);_0x3aa1c1(_0x3b070b[_0xf32b('0x16')](0x1f4,_0x1f3c05['message']));});});};exports[_0xf32b('0x29')]=function(_0x303fb6){var _0x133882=this;return new Promise(function(_0x40abdc,_0x2248d9){return db[_0xf32b('0x1c')]['find']({'raw':_0x303fb6['options']?_0x303fb6[_0xf32b('0x1e')][_0xf32b('0x1f')]===undefined?!![]:![]:!![],'where':_0x303fb6[_0xf32b('0x1e')]?_0x303fb6['options'][_0xf32b('0x20')]||null:null,'attributes':_0x303fb6[_0xf32b('0x1e')]?_0x303fb6['options'][_0xf32b('0x21')]||null:null,'include':_0x303fb6[_0xf32b('0x1e')]?_0x303fb6[_0xf32b('0x1e')][_0xf32b('0x23')]?_[_0xf32b('0x24')](_0x303fb6[_0xf32b('0x1e')][_0xf32b('0x23')],function(_0x48a488){return{'model':db[_0x48a488[_0xf32b('0x25')]],'as':_0x48a488['as'],'attributes':_0x48a488['attributes'],'include':_0x48a488['include']?_['map'](_0x48a488[_0xf32b('0x23')],function(_0x2a370d){return{'model':db[_0x2a370d[_0xf32b('0x25')]],'as':_0x2a370d['as'],'attributes':_0x2a370d['attributes'],'include':_0x2a370d['include']?_['map'](_0x2a370d[_0xf32b('0x23')],function(_0x43a77a){return{'model':db[_0x43a77a[_0xf32b('0x25')]],'as':_0x43a77a['as'],'attributes':_0x43a77a[_0xf32b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf32b('0x12')](function(_0x2c4b5a){logger[_0xf32b('0x19')](_0xf32b('0x29'),_0x303fb6);logger['debug']('ShowOpenchannelQueue',_0x303fb6,JSON['stringify'](_0x2c4b5a));_0x40abdc(_0x2c4b5a);})[_0xf32b('0x1b')](function(_0x47eb22){logger['error'](_0xf32b('0x29'),_0x47eb22[_0xf32b('0x18')],_0x303fb6);_0x2248d9(_0x133882['error'](0x1f4,_0x47eb22[_0xf32b('0x18')]));});});};
\ No newline at end of file