Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 6823316..7ba6988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47f6=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','OpenchannelQueue','findAll','options','raw','where','include','map','model','attributes','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find'];(function(_0x30ebf9,_0x4ef16a){var _0x2b0850=function(_0x3ffab1){while(--_0x3ffab1){_0x30ebf9['push'](_0x30ebf9['shift']());}};_0x2b0850(++_0x4ef16a);}(_0x47f6,0x7b));var _0x647f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x647f('0x0'));var util=require(_0x647f('0x1'));var moment=require(_0x647f('0x2'));var BPromise=require(_0x647f('0x3'));var rs=require(_0x647f('0x4'));var fs=require('fs');var Redis=require(_0x647f('0x5'));var db=require(_0x647f('0x6'))['db'];var utils=require(_0x647f('0x7'));var logger=require('../../config/logger')(_0x647f('0x8'));var config=require(_0x647f('0x9'));var jayson=require(_0x647f('0xa'));var client=jayson[_0x647f('0xb')][_0x647f('0xc')]({'port':0x232a});config[_0x647f('0xd')]=_['defaults'](config[_0x647f('0xd')],{'host':_0x647f('0xe'),'port':0x18eb});var socket=require(_0x647f('0xf'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x647f('0x10')](socket);function respondWithRpcPromise(_0x3a3319,_0x3c8fe1,_0x479c3c){return new BPromise(function(_0x18ae2d,_0x48834f){return client[_0x647f('0x11')](_0x3a3319,_0x479c3c)[_0x647f('0x12')](function(_0x1291d8){logger[_0x647f('0x13')](_0x647f('0x14'),_0x3c8fe1,_0x647f('0x15'));logger['debug'](_0x647f('0x16'),_0x3c8fe1,_0x647f('0x15'),JSON[_0x647f('0x17')](_0x1291d8));if(_0x1291d8[_0x647f('0x18')]){if(_0x1291d8[_0x647f('0x18')]['code']===0x1f4){logger[_0x647f('0x18')](_0x647f('0x14'),_0x3c8fe1,_0x1291d8[_0x647f('0x18')][_0x647f('0x19')]);return _0x48834f(_0x1291d8[_0x647f('0x18')][_0x647f('0x19')]);}logger[_0x647f('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x3c8fe1,_0x1291d8[_0x647f('0x18')][_0x647f('0x19')]);return _0x18ae2d(_0x1291d8['error'][_0x647f('0x19')]);}else{logger[_0x647f('0x13')](_0x647f('0x14'),_0x3c8fe1,_0x647f('0x15'));_0x18ae2d(_0x1291d8[_0x647f('0x1a')][_0x647f('0x19')]);}})[_0x647f('0x1b')](function(_0x19fb00){logger[_0x647f('0x18')](_0x647f('0x14'),_0x3c8fe1,_0x19fb00);_0x48834f(_0x19fb00);});});}exports['GetOpenchannelQueue']=function(_0x3bd597){var _0x454726=this;return new Promise(function(_0x27f5a5,_0x344fab){return db[_0x647f('0x1c')][_0x647f('0x1d')]({'raw':_0x3bd597[_0x647f('0x1e')]?_0x3bd597[_0x647f('0x1e')][_0x647f('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bd597[_0x647f('0x1e')]?_0x3bd597[_0x647f('0x1e')][_0x647f('0x20')]||null:null,'attributes':_0x3bd597[_0x647f('0x1e')]?_0x3bd597[_0x647f('0x1e')]['attributes']||null:null,'limit':_0x3bd597['options']?_0x3bd597['options']['limit']||null:null,'include':_0x3bd597[_0x647f('0x1e')]?_0x3bd597[_0x647f('0x1e')][_0x647f('0x21')]?_[_0x647f('0x22')](_0x3bd597['options'][_0x647f('0x21')],function(_0x185bb8){return{'model':db[_0x185bb8[_0x647f('0x23')]],'as':_0x185bb8['as'],'attributes':_0x185bb8[_0x647f('0x24')],'include':_0x185bb8[_0x647f('0x21')]?_[_0x647f('0x22')](_0x185bb8['include'],function(_0x5e161a){return{'model':db[_0x5e161a[_0x647f('0x23')]],'as':_0x5e161a['as'],'attributes':_0x5e161a[_0x647f('0x24')],'include':_0x5e161a[_0x647f('0x21')]?_['map'](_0x5e161a[_0x647f('0x21')],function(_0xb7ad0){return{'model':db[_0xb7ad0['model']],'as':_0xb7ad0['as'],'attributes':_0xb7ad0[_0x647f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x647f('0x12')](function(_0x2b57bb){logger['info'](_0x647f('0x25'),_0x3bd597);logger[_0x647f('0x26')](_0x647f('0x25'),_0x3bd597,JSON[_0x647f('0x17')](_0x2b57bb));_0x27f5a5(_0x2b57bb);})[_0x647f('0x1b')](function(_0x362d10){logger[_0x647f('0x18')](_0x647f('0x25'),_0x362d10[_0x647f('0x19')],_0x3bd597);_0x344fab(_0x454726[_0x647f('0x18')](0x1f4,_0x362d10[_0x647f('0x19')]));});});};exports[_0x647f('0x27')]=function(_0x5bcb2e){var _0x40bb4f=this;return new Promise(function(_0x39c824,_0x37c573){return db[_0x647f('0x1c')][_0x647f('0x28')]({'raw':_0x5bcb2e[_0x647f('0x1e')]?_0x5bcb2e[_0x647f('0x1e')][_0x647f('0x1f')]===undefined?!![]:![]:!![],'where':_0x5bcb2e[_0x647f('0x1e')]?_0x5bcb2e[_0x647f('0x1e')][_0x647f('0x20')]||null:null,'attributes':_0x5bcb2e[_0x647f('0x1e')]?_0x5bcb2e[_0x647f('0x1e')][_0x647f('0x24')]||null:null,'include':_0x5bcb2e[_0x647f('0x1e')]?_0x5bcb2e[_0x647f('0x1e')]['include']?_['map'](_0x5bcb2e['options'][_0x647f('0x21')],function(_0x17cbb3){return{'model':db[_0x17cbb3[_0x647f('0x23')]],'as':_0x17cbb3['as'],'attributes':_0x17cbb3[_0x647f('0x24')],'include':_0x17cbb3[_0x647f('0x21')]?_[_0x647f('0x22')](_0x17cbb3[_0x647f('0x21')],function(_0x273409){return{'model':db[_0x273409[_0x647f('0x23')]],'as':_0x273409['as'],'attributes':_0x273409[_0x647f('0x24')],'include':_0x273409[_0x647f('0x21')]?_[_0x647f('0x22')](_0x273409[_0x647f('0x21')],function(_0x3cb103){return{'model':db[_0x3cb103[_0x647f('0x23')]],'as':_0x3cb103['as'],'attributes':_0x3cb103[_0x647f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x647f('0x12')](function(_0x23c622){logger[_0x647f('0x13')](_0x647f('0x27'),_0x5bcb2e);logger[_0x647f('0x26')](_0x647f('0x27'),_0x5bcb2e,JSON[_0x647f('0x17')](_0x23c622));_0x39c824(_0x23c622);})[_0x647f('0x1b')](function(_0x127c26){logger[_0x647f('0x18')](_0x647f('0x27'),_0x127c26[_0x647f('0x19')],_0x5bcb2e);_0x37c573(_0x40bb4f[_0x647f('0x18')](0x1f4,_0x127c26['message']));});});};
\ No newline at end of file
+var _0x896a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','map','include','attributes','model','stringify','ShowOpenchannelQueue','find','raw','lodash','bluebird','ioredis'];(function(_0x312779,_0x43131e){var _0x8b34ea=function(_0x450876){while(--_0x450876){_0x312779['push'](_0x312779['shift']());}};_0x8b34ea(++_0x43131e);}(_0x896a,0xf3));var _0xa896=function(_0x43cd49,_0x5f3168){_0x43cd49=_0x43cd49-0x0;var _0x320d13=_0x896a[_0x43cd49];return _0x320d13;};'use strict';var _=require(_0xa896('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa896('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa896('0x2'));var db=require(_0xa896('0x3'))['db'];var utils=require(_0xa896('0x4'));var logger=require(_0xa896('0x5'))(_0xa896('0x6'));var config=require(_0xa896('0x7'));var jayson=require(_0xa896('0x8'));var client=jayson[_0xa896('0x9')][_0xa896('0xa')]({'port':0x232a});config[_0xa896('0xb')]=_[_0xa896('0xc')](config[_0xa896('0xb')],{'host':_0xa896('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa896('0xe'))[_0xa896('0xf')](socket);function respondWithRpcPromise(_0x3fb042,_0x2d8bc4,_0xd92596){return new BPromise(function(_0x3dbc6c,_0x2ddfbb){return client[_0xa896('0x10')](_0x3fb042,_0xd92596)[_0xa896('0x11')](function(_0x3bc82b){logger[_0xa896('0x12')](_0xa896('0x13'),_0x2d8bc4,_0xa896('0x14'));logger[_0xa896('0x15')](_0xa896('0x16'),_0x2d8bc4,_0xa896('0x14'),JSON['stringify'](_0x3bc82b));if(_0x3bc82b[_0xa896('0x17')]){if(_0x3bc82b[_0xa896('0x17')][_0xa896('0x18')]===0x1f4){logger['error'](_0xa896('0x13'),_0x2d8bc4,_0x3bc82b[_0xa896('0x17')][_0xa896('0x19')]);return _0x2ddfbb(_0x3bc82b[_0xa896('0x17')][_0xa896('0x19')]);}logger[_0xa896('0x17')](_0xa896('0x13'),_0x2d8bc4,_0x3bc82b['error'][_0xa896('0x19')]);return _0x3dbc6c(_0x3bc82b[_0xa896('0x17')]['message']);}else{logger[_0xa896('0x12')](_0xa896('0x13'),_0x2d8bc4,'request\x20sent');_0x3dbc6c(_0x3bc82b[_0xa896('0x1a')][_0xa896('0x19')]);}})[_0xa896('0x1b')](function(_0x1d1ba2){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2d8bc4,_0x1d1ba2);_0x2ddfbb(_0x1d1ba2);});});}exports[_0xa896('0x1c')]=function(_0x8ef81b){var _0x1a5c41=this;return new Promise(function(_0x42e274,_0x258be7){return db[_0xa896('0x1d')][_0xa896('0x1e')]({'raw':_0x8ef81b[_0xa896('0x1f')]?_0x8ef81b['options']['raw']===undefined?!![]:![]:!![],'where':_0x8ef81b[_0xa896('0x1f')]?_0x8ef81b[_0xa896('0x1f')][_0xa896('0x20')]||null:null,'attributes':_0x8ef81b['options']?_0x8ef81b['options']['attributes']||null:null,'limit':_0x8ef81b[_0xa896('0x1f')]?_0x8ef81b['options']['limit']||null:null,'include':_0x8ef81b['options']?_0x8ef81b[_0xa896('0x1f')]['include']?_[_0xa896('0x21')](_0x8ef81b[_0xa896('0x1f')][_0xa896('0x22')],function(_0x12f999){return{'model':db[_0x12f999['model']],'as':_0x12f999['as'],'attributes':_0x12f999[_0xa896('0x23')],'include':_0x12f999[_0xa896('0x22')]?_[_0xa896('0x21')](_0x12f999[_0xa896('0x22')],function(_0x4b4a61){return{'model':db[_0x4b4a61[_0xa896('0x24')]],'as':_0x4b4a61['as'],'attributes':_0x4b4a61[_0xa896('0x23')],'include':_0x4b4a61[_0xa896('0x22')]?_[_0xa896('0x21')](_0x4b4a61[_0xa896('0x22')],function(_0x437cc3){return{'model':db[_0x437cc3[_0xa896('0x24')]],'as':_0x437cc3['as'],'attributes':_0x437cc3[_0xa896('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa896('0x11')](function(_0x3a833){logger[_0xa896('0x12')]('GetOpenchannelQueue',_0x8ef81b);logger[_0xa896('0x15')](_0xa896('0x1c'),_0x8ef81b,JSON[_0xa896('0x25')](_0x3a833));_0x42e274(_0x3a833);})[_0xa896('0x1b')](function(_0x1276e4){logger[_0xa896('0x17')](_0xa896('0x1c'),_0x1276e4[_0xa896('0x19')],_0x8ef81b);_0x258be7(_0x1a5c41['error'](0x1f4,_0x1276e4[_0xa896('0x19')]));});});};exports[_0xa896('0x26')]=function(_0xcbf164){var _0x5d7d90=this;return new Promise(function(_0x11d65d,_0x5abdaf){return db['OpenchannelQueue'][_0xa896('0x27')]({'raw':_0xcbf164['options']?_0xcbf164['options'][_0xa896('0x28')]===undefined?!![]:![]:!![],'where':_0xcbf164[_0xa896('0x1f')]?_0xcbf164[_0xa896('0x1f')][_0xa896('0x20')]||null:null,'attributes':_0xcbf164['options']?_0xcbf164['options'][_0xa896('0x23')]||null:null,'include':_0xcbf164[_0xa896('0x1f')]?_0xcbf164[_0xa896('0x1f')][_0xa896('0x22')]?_[_0xa896('0x21')](_0xcbf164[_0xa896('0x1f')]['include'],function(_0x26b0f4){return{'model':db[_0x26b0f4[_0xa896('0x24')]],'as':_0x26b0f4['as'],'attributes':_0x26b0f4['attributes'],'include':_0x26b0f4[_0xa896('0x22')]?_[_0xa896('0x21')](_0x26b0f4[_0xa896('0x22')],function(_0x4bf41e){return{'model':db[_0x4bf41e[_0xa896('0x24')]],'as':_0x4bf41e['as'],'attributes':_0x4bf41e['attributes'],'include':_0x4bf41e['include']?_[_0xa896('0x21')](_0x4bf41e[_0xa896('0x22')],function(_0x5d7adc){return{'model':db[_0x5d7adc[_0xa896('0x24')]],'as':_0x5d7adc['as'],'attributes':_0x5d7adc[_0xa896('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa896('0x11')](function(_0xeb1010){logger[_0xa896('0x12')]('ShowOpenchannelQueue',_0xcbf164);logger[_0xa896('0x15')](_0xa896('0x26'),_0xcbf164,JSON[_0xa896('0x25')](_0xeb1010));_0x11d65d(_0xeb1010);})[_0xa896('0x1b')](function(_0x17d13c){logger[_0xa896('0x17')](_0xa896('0x26'),_0x17d13c['message'],_0xcbf164);_0x5abdaf(_0x5d7d90[_0xa896('0x17')](0x1f4,_0x17d13c[_0xa896('0x19')]));});});};
\ No newline at end of file