Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index e6b0ed6..54a9e1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','findAll','raw','options','where','attributes','include','map','model','GetOpenchannelQueue','debug','stringify','ShowOpenchannelQueue','OpenchannelQueue','lodash','moment','bluebird','randomstring'];(function(_0xa164df,_0x5d69eb){var _0x29b157=function(_0x3e601d){while(--_0x3e601d){_0xa164df['push'](_0xa164df['shift']());}};_0x29b157(++_0x5d69eb);}(_0x9c5b,0x1d0));var _0xb9c5=function(_0x3e3f27,_0x2c2ecf){_0x3e3f27=_0x3e3f27-0x0;var _0x15c868=_0x9c5b[_0x3e3f27];return _0x15c868;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var moment=require(_0xb9c5('0x1'));var BPromise=require(_0xb9c5('0x2'));var rs=require(_0xb9c5('0x3'));var fs=require('fs');var Redis=require(_0xb9c5('0x4'));var db=require(_0xb9c5('0x5'))['db'];var utils=require(_0xb9c5('0x6'));var logger=require(_0xb9c5('0x7'))(_0xb9c5('0x8'));var config=require('../../config/environment');var jayson=require(_0xb9c5('0x9'));var client=jayson['client'][_0xb9c5('0xa')]({'port':0x232a});config[_0xb9c5('0xb')]=_[_0xb9c5('0xc')](config[_0xb9c5('0xb')],{'host':_0xb9c5('0xd'),'port':0x18eb});var socket=require(_0xb9c5('0xe'))(new Redis(config[_0xb9c5('0xb')]));require(_0xb9c5('0xf'))['register'](socket);function respondWithRpcPromise(_0x4e71df,_0x220fca,_0x5e1187){return new BPromise(function(_0x3d1a8f,_0x1c5f2f){return client[_0xb9c5('0x10')](_0x4e71df,_0x5e1187)[_0xb9c5('0x11')](function(_0x4251ef){logger[_0xb9c5('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0xb9c5('0x13'));logger['debug'](_0xb9c5('0x14'),_0x220fca,_0xb9c5('0x13'),JSON['stringify'](_0x4251ef));if(_0x4251ef[_0xb9c5('0x15')]){if(_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x16')]===0x1f4){logger['error'](_0xb9c5('0x17'),_0x220fca,_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x18')]);return _0x1c5f2f(_0x4251ef['error']['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x18')]);return _0x3d1a8f(_0x4251ef[_0xb9c5('0x15')]['message']);}else{logger['info'](_0xb9c5('0x17'),_0x220fca,'request\x20sent');_0x3d1a8f(_0x4251ef['result'][_0xb9c5('0x18')]);}})[_0xb9c5('0x19')](function(_0x284a85){logger[_0xb9c5('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0x284a85);_0x1c5f2f(_0x284a85);});});}exports['GetOpenchannelQueue']=function(_0x2ffbaf){var _0x431ea2=this;return new Promise(function(_0x19c5ab,_0x28d089){return db['OpenchannelQueue'][_0xb9c5('0x1a')]({'raw':_0x2ffbaf['options']?_0x2ffbaf['options'][_0xb9c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf['options'][_0xb9c5('0x1d')]||null:null,'attributes':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf[_0xb9c5('0x1c')][_0xb9c5('0x1e')]||null:null,'limit':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf[_0xb9c5('0x1c')]['limit']||null:null,'include':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf['options'][_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x2ffbaf['options'][_0xb9c5('0x1f')],function(_0x23452d){return{'model':db[_0x23452d['model']],'as':_0x23452d['as'],'attributes':_0x23452d[_0xb9c5('0x1e')],'include':_0x23452d['include']?_[_0xb9c5('0x20')](_0x23452d[_0xb9c5('0x1f')],function(_0x2d2973){return{'model':db[_0x2d2973[_0xb9c5('0x21')]],'as':_0x2d2973['as'],'attributes':_0x2d2973['attributes'],'include':_0x2d2973[_0xb9c5('0x1f')]?_['map'](_0x2d2973[_0xb9c5('0x1f')],function(_0x13366c){return{'model':db[_0x13366c['model']],'as':_0x13366c['as'],'attributes':_0x13366c[_0xb9c5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0x11')](function(_0x2fc408){logger[_0xb9c5('0x12')](_0xb9c5('0x22'),_0x2ffbaf);logger[_0xb9c5('0x23')](_0xb9c5('0x22'),_0x2ffbaf,JSON[_0xb9c5('0x24')](_0x2fc408));_0x19c5ab(_0x2fc408);})[_0xb9c5('0x19')](function(_0xa7a014){logger['error'](_0xb9c5('0x22'),_0xa7a014[_0xb9c5('0x18')],_0x2ffbaf);_0x28d089(_0x431ea2[_0xb9c5('0x15')](0x1f4,_0xa7a014[_0xb9c5('0x18')]));});});};exports[_0xb9c5('0x25')]=function(_0x241cb0){var _0x33550a=this;return new Promise(function(_0x1eff05,_0x923dc){return db[_0xb9c5('0x26')]['find']({'raw':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0['options'][_0xb9c5('0x1d')]||null:null,'attributes':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1e')]||null:null,'include':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1f')]?_['map'](_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1f')],function(_0x3f8564){return{'model':db[_0x3f8564[_0xb9c5('0x21')]],'as':_0x3f8564['as'],'attributes':_0x3f8564[_0xb9c5('0x1e')],'include':_0x3f8564[_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x3f8564[_0xb9c5('0x1f')],function(_0x30d4ba){return{'model':db[_0x30d4ba['model']],'as':_0x30d4ba['as'],'attributes':_0x30d4ba[_0xb9c5('0x1e')],'include':_0x30d4ba[_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x30d4ba['include'],function(_0x3871a4){return{'model':db[_0x3871a4['model']],'as':_0x3871a4['as'],'attributes':_0x3871a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9c5('0x11')](function(_0x55b406){logger[_0xb9c5('0x12')](_0xb9c5('0x25'),_0x241cb0);logger['debug'](_0xb9c5('0x25'),_0x241cb0,JSON['stringify'](_0x55b406));_0x1eff05(_0x55b406);})[_0xb9c5('0x19')](function(_0xf86b8f){logger[_0xb9c5('0x15')]('ShowOpenchannelQueue',_0xf86b8f[_0xb9c5('0x18')],_0x241cb0);_0x923dc(_0x33550a[_0xb9c5('0x15')](0x1f4,_0xf86b8f[_0xb9c5('0x18')]));});});};
\ No newline at end of file
+var _0x6343=['findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowOpenchannelQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetOpenchannelQueue'];(function(_0x528342,_0x17a981){var _0x27dd91=function(_0x20bed6){while(--_0x20bed6){_0x528342['push'](_0x528342['shift']());}};_0x27dd91(++_0x17a981);}(_0x6343,0x1c5));var _0x3634=function(_0x584650,_0x57139e){_0x584650=_0x584650-0x0;var _0x5125a8=_0x6343[_0x584650];return _0x5125a8;};'use strict';var _=require(_0x3634('0x0'));var util=require('util');var moment=require(_0x3634('0x1'));var BPromise=require('bluebird');var rs=require(_0x3634('0x2'));var fs=require('fs');var Redis=require(_0x3634('0x3'));var db=require(_0x3634('0x4'))['db'];var utils=require(_0x3634('0x5'));var logger=require('../../config/logger')(_0x3634('0x6'));var config=require(_0x3634('0x7'));var jayson=require(_0x3634('0x8'));var client=jayson[_0x3634('0x9')]['http']({'port':0x232a});config[_0x3634('0xa')]=_[_0x3634('0xb')](config[_0x3634('0xa')],{'host':_0x3634('0xc'),'port':0x18eb});var socket=require(_0x3634('0xd'))(new Redis(config[_0x3634('0xa')]));require('./openchannelQueue.socket')[_0x3634('0xe')](socket);function respondWithRpcPromise(_0x792432,_0x3f3409,_0x5998f8){return new BPromise(function(_0x4684c2,_0xaa330c){return client[_0x3634('0xf')](_0x792432,_0x5998f8)[_0x3634('0x10')](function(_0x349cac){logger['info'](_0x3634('0x11'),_0x3f3409,_0x3634('0x12'));logger['debug'](_0x3634('0x13'),_0x3f3409,_0x3634('0x12'),JSON['stringify'](_0x349cac));if(_0x349cac[_0x3634('0x14')]){if(_0x349cac[_0x3634('0x14')][_0x3634('0x15')]===0x1f4){logger['error'](_0x3634('0x11'),_0x3f3409,_0x349cac[_0x3634('0x14')][_0x3634('0x16')]);return _0xaa330c(_0x349cac[_0x3634('0x14')][_0x3634('0x16')]);}logger[_0x3634('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x3f3409,_0x349cac[_0x3634('0x14')][_0x3634('0x16')]);return _0x4684c2(_0x349cac[_0x3634('0x14')][_0x3634('0x16')]);}else{logger[_0x3634('0x17')](_0x3634('0x11'),_0x3f3409,'request\x20sent');_0x4684c2(_0x349cac[_0x3634('0x18')]['message']);}})[_0x3634('0x19')](function(_0x3934ba){logger[_0x3634('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x3f3409,_0x3934ba);_0xaa330c(_0x3934ba);});});}exports[_0x3634('0x1a')]=function(_0x5073d2){var _0x2a8035=this;return new Promise(function(_0x425e28,_0x5cd237){return db['OpenchannelQueue'][_0x3634('0x1b')]({'raw':_0x5073d2['options']?_0x5073d2[_0x3634('0x1c')][_0x3634('0x1d')]===undefined?!![]:![]:!![],'where':_0x5073d2[_0x3634('0x1c')]?_0x5073d2[_0x3634('0x1c')][_0x3634('0x1e')]||null:null,'attributes':_0x5073d2['options']?_0x5073d2['options'][_0x3634('0x1f')]||null:null,'limit':_0x5073d2[_0x3634('0x1c')]?_0x5073d2['options'][_0x3634('0x20')]||null:null,'include':_0x5073d2[_0x3634('0x1c')]?_0x5073d2[_0x3634('0x1c')][_0x3634('0x21')]?_[_0x3634('0x22')](_0x5073d2[_0x3634('0x1c')]['include'],function(_0x2a7c59){return{'model':db[_0x2a7c59[_0x3634('0x23')]],'as':_0x2a7c59['as'],'attributes':_0x2a7c59[_0x3634('0x1f')],'include':_0x2a7c59['include']?_[_0x3634('0x22')](_0x2a7c59[_0x3634('0x21')],function(_0x877643){return{'model':db[_0x877643[_0x3634('0x23')]],'as':_0x877643['as'],'attributes':_0x877643[_0x3634('0x1f')],'include':_0x877643[_0x3634('0x21')]?_[_0x3634('0x22')](_0x877643[_0x3634('0x21')],function(_0xb8ac65){return{'model':db[_0xb8ac65[_0x3634('0x23')]],'as':_0xb8ac65['as'],'attributes':_0xb8ac65[_0x3634('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3634('0x10')](function(_0x4d31a8){logger['info'](_0x3634('0x1a'),_0x5073d2);logger[_0x3634('0x24')]('GetOpenchannelQueue',_0x5073d2,JSON[_0x3634('0x25')](_0x4d31a8));_0x425e28(_0x4d31a8);})['catch'](function(_0x163a05){logger[_0x3634('0x14')](_0x3634('0x1a'),_0x163a05['message'],_0x5073d2);_0x5cd237(_0x2a8035['error'](0x1f4,_0x163a05['message']));});});};exports[_0x3634('0x26')]=function(_0x541c9e){var _0x4e24dd=this;return new Promise(function(_0x5409e1,_0x475af7){return db['OpenchannelQueue'][_0x3634('0x27')]({'raw':_0x541c9e[_0x3634('0x1c')]?_0x541c9e['options'][_0x3634('0x1d')]===undefined?!![]:![]:!![],'where':_0x541c9e[_0x3634('0x1c')]?_0x541c9e['options'][_0x3634('0x1e')]||null:null,'attributes':_0x541c9e['options']?_0x541c9e[_0x3634('0x1c')][_0x3634('0x1f')]||null:null,'include':_0x541c9e['options']?_0x541c9e[_0x3634('0x1c')][_0x3634('0x21')]?_[_0x3634('0x22')](_0x541c9e[_0x3634('0x1c')]['include'],function(_0x2d29e8){return{'model':db[_0x2d29e8['model']],'as':_0x2d29e8['as'],'attributes':_0x2d29e8[_0x3634('0x1f')],'include':_0x2d29e8[_0x3634('0x21')]?_['map'](_0x2d29e8[_0x3634('0x21')],function(_0x632a11){return{'model':db[_0x632a11['model']],'as':_0x632a11['as'],'attributes':_0x632a11[_0x3634('0x1f')],'include':_0x632a11['include']?_['map'](_0x632a11[_0x3634('0x21')],function(_0x2378ed){return{'model':db[_0x2378ed[_0x3634('0x23')]],'as':_0x2378ed['as'],'attributes':_0x2378ed[_0x3634('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x570625){logger[_0x3634('0x17')](_0x3634('0x26'),_0x541c9e);logger[_0x3634('0x24')](_0x3634('0x26'),_0x541c9e,JSON['stringify'](_0x570625));_0x5409e1(_0x570625);})[_0x3634('0x19')](function(_0x512bba){logger[_0x3634('0x14')](_0x3634('0x26'),_0x512bba[_0x3634('0x16')],_0x541c9e);_0x475af7(_0x4e24dd[_0x3634('0x14')](0x1f4,_0x512bba[_0x3634('0x16')]));});});};
\ No newline at end of file