Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 9f676d7..e39c6f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd8f=['jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','limit','include','map','model','attributes','ShowOpenchannelQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xd33801,_0x2c8c0f){var _0x420bb9=function(_0x55fad2){while(--_0x55fad2){_0xd33801['push'](_0xd33801['shift']());}};_0x420bb9(++_0x2c8c0f);}(_0xdd8f,0x1f2));var _0xfdd8=function(_0x16990e,_0x260a75){_0x16990e=_0x16990e-0x0;var _0x3df36e=_0xdd8f[_0x16990e];return _0x3df36e;};'use strict';var _=require(_0xfdd8('0x0'));var util=require('util');var moment=require(_0xfdd8('0x1'));var BPromise=require(_0xfdd8('0x2'));var rs=require(_0xfdd8('0x3'));var fs=require('fs');var Redis=require(_0xfdd8('0x4'));var db=require(_0xfdd8('0x5'))['db'];var utils=require(_0xfdd8('0x6'));var logger=require(_0xfdd8('0x7'))('rpc');var config=require(_0xfdd8('0x8'));var jayson=require(_0xfdd8('0x9'));var client=jayson[_0xfdd8('0xa')]['http']({'port':0x232a});config['redis']=_[_0xfdd8('0xb')](config['redis'],{'host':_0xfdd8('0xc'),'port':0x18eb});var socket=require(_0xfdd8('0xd'))(new Redis(config[_0xfdd8('0xe')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1fcf1c,_0x29d432,_0x263529){return new BPromise(function(_0x175f4a,_0x505c3f){return client[_0xfdd8('0xf')](_0x1fcf1c,_0x263529)[_0xfdd8('0x10')](function(_0x2683ec){logger[_0xfdd8('0x11')](_0xfdd8('0x12'),_0x29d432,'request\x20sent');logger[_0xfdd8('0x13')](_0xfdd8('0x14'),_0x29d432,_0xfdd8('0x15'),JSON[_0xfdd8('0x16')](_0x2683ec));if(_0x2683ec[_0xfdd8('0x17')]){if(_0x2683ec[_0xfdd8('0x17')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x29d432,_0x2683ec['error']['message']);return _0x505c3f(_0x2683ec[_0xfdd8('0x17')]['message']);}logger[_0xfdd8('0x17')](_0xfdd8('0x12'),_0x29d432,_0x2683ec['error'][_0xfdd8('0x18')]);return _0x175f4a(_0x2683ec[_0xfdd8('0x17')][_0xfdd8('0x18')]);}else{logger[_0xfdd8('0x11')](_0xfdd8('0x12'),_0x29d432,'request\x20sent');_0x175f4a(_0x2683ec[_0xfdd8('0x19')][_0xfdd8('0x18')]);}})[_0xfdd8('0x1a')](function(_0x289aa7){logger[_0xfdd8('0x17')](_0xfdd8('0x12'),_0x29d432,_0x289aa7);_0x505c3f(_0x289aa7);});});}exports[_0xfdd8('0x1b')]=function(_0x54d0e0){var _0x21492d=this;return new Promise(function(_0x2fcc07,_0x561b19){return db[_0xfdd8('0x1c')]['findAll']({'raw':_0x54d0e0[_0xfdd8('0x1d')]?_0x54d0e0[_0xfdd8('0x1d')][_0xfdd8('0x1e')]===undefined?!![]:![]:!![],'where':_0x54d0e0[_0xfdd8('0x1d')]?_0x54d0e0[_0xfdd8('0x1d')]['where']||null:null,'attributes':_0x54d0e0['options']?_0x54d0e0['options']['attributes']||null:null,'limit':_0x54d0e0['options']?_0x54d0e0[_0xfdd8('0x1d')][_0xfdd8('0x1f')]||null:null,'include':_0x54d0e0[_0xfdd8('0x1d')]?_0x54d0e0[_0xfdd8('0x1d')][_0xfdd8('0x20')]?_[_0xfdd8('0x21')](_0x54d0e0[_0xfdd8('0x1d')]['include'],function(_0x6777e7){return{'model':db[_0x6777e7[_0xfdd8('0x22')]],'as':_0x6777e7['as'],'attributes':_0x6777e7['attributes'],'include':_0x6777e7[_0xfdd8('0x20')]?_[_0xfdd8('0x21')](_0x6777e7[_0xfdd8('0x20')],function(_0x586f06){return{'model':db[_0x586f06[_0xfdd8('0x22')]],'as':_0x586f06['as'],'attributes':_0x586f06[_0xfdd8('0x23')],'include':_0x586f06[_0xfdd8('0x20')]?_['map'](_0x586f06['include'],function(_0x33542d){return{'model':db[_0x33542d[_0xfdd8('0x22')]],'as':_0x33542d['as'],'attributes':_0x33542d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16a71c){logger[_0xfdd8('0x11')](_0xfdd8('0x1b'),_0x54d0e0);logger['debug'](_0xfdd8('0x1b'),_0x54d0e0,JSON[_0xfdd8('0x16')](_0x16a71c));_0x2fcc07(_0x16a71c);})[_0xfdd8('0x1a')](function(_0x537745){logger[_0xfdd8('0x17')]('GetOpenchannelQueue',_0x537745[_0xfdd8('0x18')],_0x54d0e0);_0x561b19(_0x21492d[_0xfdd8('0x17')](0x1f4,_0x537745[_0xfdd8('0x18')]));});});};exports[_0xfdd8('0x24')]=function(_0x13e31b){var _0x658a10=this;return new Promise(function(_0x2011ff,_0x20ff72){return db[_0xfdd8('0x1c')][_0xfdd8('0x25')]({'raw':_0x13e31b[_0xfdd8('0x1d')]?_0x13e31b[_0xfdd8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x13e31b[_0xfdd8('0x1d')]?_0x13e31b[_0xfdd8('0x1d')][_0xfdd8('0x26')]||null:null,'attributes':_0x13e31b[_0xfdd8('0x1d')]?_0x13e31b['options'][_0xfdd8('0x23')]||null:null,'include':_0x13e31b['options']?_0x13e31b[_0xfdd8('0x1d')][_0xfdd8('0x20')]?_[_0xfdd8('0x21')](_0x13e31b[_0xfdd8('0x1d')]['include'],function(_0x3cad95){return{'model':db[_0x3cad95[_0xfdd8('0x22')]],'as':_0x3cad95['as'],'attributes':_0x3cad95['attributes'],'include':_0x3cad95['include']?_[_0xfdd8('0x21')](_0x3cad95[_0xfdd8('0x20')],function(_0x3f9a38){return{'model':db[_0x3f9a38[_0xfdd8('0x22')]],'as':_0x3f9a38['as'],'attributes':_0x3f9a38[_0xfdd8('0x23')],'include':_0x3f9a38[_0xfdd8('0x20')]?_[_0xfdd8('0x21')](_0x3f9a38[_0xfdd8('0x20')],function(_0x352c88){return{'model':db[_0x352c88[_0xfdd8('0x22')]],'as':_0x352c88['as'],'attributes':_0x352c88[_0xfdd8('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfdd8('0x10')](function(_0x459945){logger[_0xfdd8('0x11')](_0xfdd8('0x24'),_0x13e31b);logger[_0xfdd8('0x13')](_0xfdd8('0x24'),_0x13e31b,JSON[_0xfdd8('0x16')](_0x459945));_0x2011ff(_0x459945);})['catch'](function(_0x2d2327){logger['error']('ShowOpenchannelQueue',_0x2d2327[_0xfdd8('0x18')],_0x13e31b);_0x20ff72(_0x658a10[_0xfdd8('0x17')](0x1f4,_0x2d2327[_0xfdd8('0x18')]));});});};
\ No newline at end of file
+var _0xa309=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','limit','include','map','attributes','model','then','stringify','ShowOpenchannelQueue','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','request\x20sent','debug'];(function(_0x34c0f1,_0x52ee0c){var _0xabef14=function(_0x27f20a){while(--_0x27f20a){_0x34c0f1['push'](_0x34c0f1['shift']());}};_0xabef14(++_0x52ee0c);}(_0xa309,0x1cd));var _0x9a30=function(_0x1a4e5a,_0x4cd134){_0x1a4e5a=_0x1a4e5a-0x0;var _0x28e285=_0xa309[_0x1a4e5a];return _0x28e285;};'use strict';var _=require('lodash');var util=require(_0x9a30('0x0'));var moment=require('moment');var BPromise=require(_0x9a30('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a30('0x2'));var db=require(_0x9a30('0x3'))['db'];var utils=require(_0x9a30('0x4'));var logger=require(_0x9a30('0x5'))('rpc');var config=require(_0x9a30('0x6'));var jayson=require(_0x9a30('0x7'));var client=jayson[_0x9a30('0x8')][_0x9a30('0x9')]({'port':0x232a});config[_0x9a30('0xa')]=_[_0x9a30('0xb')](config[_0x9a30('0xa')],{'host':_0x9a30('0xc'),'port':0x18eb});var socket=require(_0x9a30('0xd'))(new Redis(config['redis']));require(_0x9a30('0xe'))[_0x9a30('0xf')](socket);function respondWithRpcPromise(_0x180e9c,_0x22558b,_0x197071){return new BPromise(function(_0x4d405d,_0x55a70a){return client[_0x9a30('0x10')](_0x180e9c,_0x197071)['then'](function(_0x2fc78d){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x9a30('0x11'));logger[_0x9a30('0x12')](_0x9a30('0x13'),_0x22558b,_0x9a30('0x11'),JSON['stringify'](_0x2fc78d));if(_0x2fc78d[_0x9a30('0x14')]){if(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x15')]===0x1f4){logger[_0x9a30('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);return _0x55a70a(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);}logger['error'](_0x9a30('0x17'),_0x22558b,_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);return _0x4d405d(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);}else{logger[_0x9a30('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x9a30('0x11'));_0x4d405d(_0x2fc78d[_0x9a30('0x19')]['message']);}})[_0x9a30('0x1a')](function(_0x1d4c39){logger[_0x9a30('0x14')](_0x9a30('0x17'),_0x22558b,_0x1d4c39);_0x55a70a(_0x1d4c39);});});}exports[_0x9a30('0x1b')]=function(_0x4a5d0e){var _0x12f126=this;return new Promise(function(_0x5b620d,_0x1b1a9c){return db[_0x9a30('0x1c')][_0x9a30('0x1d')]({'raw':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['where']||null:null,'attributes':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['attributes']||null:null,'limit':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x1f')]||null:null,'include':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x20')],function(_0x293f2a){return{'model':db[_0x293f2a['model']],'as':_0x293f2a['as'],'attributes':_0x293f2a[_0x9a30('0x22')],'include':_0x293f2a[_0x9a30('0x20')]?_['map'](_0x293f2a['include'],function(_0x3a398a){return{'model':db[_0x3a398a[_0x9a30('0x23')]],'as':_0x3a398a['as'],'attributes':_0x3a398a[_0x9a30('0x22')],'include':_0x3a398a[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x3a398a[_0x9a30('0x20')],function(_0xa1cd97){return{'model':db[_0xa1cd97[_0x9a30('0x23')]],'as':_0xa1cd97['as'],'attributes':_0xa1cd97[_0x9a30('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9a30('0x24')](function(_0x379b78){logger[_0x9a30('0x18')](_0x9a30('0x1b'),_0x4a5d0e);logger[_0x9a30('0x12')]('GetOpenchannelQueue',_0x4a5d0e,JSON[_0x9a30('0x25')](_0x379b78));_0x5b620d(_0x379b78);})['catch'](function(_0x48b5b0){logger[_0x9a30('0x14')](_0x9a30('0x1b'),_0x48b5b0[_0x9a30('0x16')],_0x4a5d0e);_0x1b1a9c(_0x12f126['error'](0x1f4,_0x48b5b0[_0x9a30('0x16')]));});});};exports[_0x9a30('0x26')]=function(_0x523f97){var _0x13e2a0=this;return new Promise(function(_0x4f6d8b,_0x24592f){return db[_0x9a30('0x1c')]['find']({'raw':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')][_0x9a30('0x27')]===undefined?!![]:![]:!![],'where':_0x523f97['options']?_0x523f97[_0x9a30('0x1e')]['where']||null:null,'attributes':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')][_0x9a30('0x22')]||null:null,'include':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')]['include']?_[_0x9a30('0x21')](_0x523f97[_0x9a30('0x1e')][_0x9a30('0x20')],function(_0x1cc58b){return{'model':db[_0x1cc58b[_0x9a30('0x23')]],'as':_0x1cc58b['as'],'attributes':_0x1cc58b['attributes'],'include':_0x1cc58b[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x1cc58b[_0x9a30('0x20')],function(_0x2672c2){return{'model':db[_0x2672c2[_0x9a30('0x23')]],'as':_0x2672c2['as'],'attributes':_0x2672c2[_0x9a30('0x22')],'include':_0x2672c2[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x2672c2[_0x9a30('0x20')],function(_0x3325cd){return{'model':db[_0x3325cd[_0x9a30('0x23')]],'as':_0x3325cd['as'],'attributes':_0x3325cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a30('0x24')](function(_0x26d4a2){logger[_0x9a30('0x18')]('ShowOpenchannelQueue',_0x523f97);logger[_0x9a30('0x12')](_0x9a30('0x26'),_0x523f97,JSON[_0x9a30('0x25')](_0x26d4a2));_0x4f6d8b(_0x26d4a2);})[_0x9a30('0x1a')](function(_0x1be9fb){logger['error'](_0x9a30('0x26'),_0x1be9fb['message'],_0x523f97);_0x24592f(_0x13e2a0['error'](0x1f4,_0x1be9fb[_0x9a30('0x16')]));});});};
\ No newline at end of file