Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 5222d46..54a9e1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf66b=['map','include','model','GetOpenchannelQueue','find','raw','ShowOpenchannelQueue','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','OpenchannelQueue','options','where','attributes'];(function(_0x375538,_0xe14ac6){var _0x34785e=function(_0x5a876a){while(--_0x5a876a){_0x375538['push'](_0x375538['shift']());}};_0x34785e(++_0xe14ac6);}(_0xf66b,0xc0));var _0xbf66=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf66b[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xbf66('0x0'));var moment=require(_0xbf66('0x1'));var BPromise=require(_0xbf66('0x2'));var rs=require(_0xbf66('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf66('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf66('0x5'));var config=require(_0xbf66('0x6'));var jayson=require(_0xbf66('0x7'));var client=jayson[_0xbf66('0x8')][_0xbf66('0x9')]({'port':0x232a});config[_0xbf66('0xa')]=_[_0xbf66('0xb')](config[_0xbf66('0xa')],{'host':_0xbf66('0xc'),'port':0x18eb});var socket=require(_0xbf66('0xd'))(new Redis(config[_0xbf66('0xa')]));require(_0xbf66('0xe'))[_0xbf66('0xf')](socket);function respondWithRpcPromise(_0x15df6d,_0x355397,_0x3c8992){return new BPromise(function(_0x253c1f,_0x2d4757){return client[_0xbf66('0x10')](_0x15df6d,_0x3c8992)[_0xbf66('0x11')](function(_0x306125){logger['info'](_0xbf66('0x12'),_0x355397,_0xbf66('0x13'));logger[_0xbf66('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x355397,'request\x20sent',JSON[_0xbf66('0x15')](_0x306125));if(_0x306125[_0xbf66('0x16')]){if(_0x306125[_0xbf66('0x16')]['code']===0x1f4){logger[_0xbf66('0x16')](_0xbf66('0x12'),_0x355397,_0x306125[_0xbf66('0x16')][_0xbf66('0x17')]);return _0x2d4757(_0x306125[_0xbf66('0x16')][_0xbf66('0x17')]);}logger[_0xbf66('0x16')](_0xbf66('0x12'),_0x355397,_0x306125[_0xbf66('0x16')][_0xbf66('0x17')]);return _0x253c1f(_0x306125[_0xbf66('0x16')][_0xbf66('0x17')]);}else{logger[_0xbf66('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x355397,_0xbf66('0x13'));_0x253c1f(_0x306125['result']['message']);}})[_0xbf66('0x19')](function(_0x1197c7){logger[_0xbf66('0x16')](_0xbf66('0x12'),_0x355397,_0x1197c7);_0x2d4757(_0x1197c7);});});}exports['GetOpenchannelQueue']=function(_0x913ec1){var _0x565ae5=this;return new Promise(function(_0x509f6e,_0x59bea4){return db[_0xbf66('0x1a')]['findAll']({'raw':_0x913ec1[_0xbf66('0x1b')]?_0x913ec1[_0xbf66('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x913ec1[_0xbf66('0x1b')]?_0x913ec1['options'][_0xbf66('0x1c')]||null:null,'attributes':_0x913ec1[_0xbf66('0x1b')]?_0x913ec1[_0xbf66('0x1b')][_0xbf66('0x1d')]||null:null,'limit':_0x913ec1[_0xbf66('0x1b')]?_0x913ec1['options']['limit']||null:null,'include':_0x913ec1[_0xbf66('0x1b')]?_0x913ec1[_0xbf66('0x1b')]['include']?_[_0xbf66('0x1e')](_0x913ec1[_0xbf66('0x1b')][_0xbf66('0x1f')],function(_0x3d049f){return{'model':db[_0x3d049f[_0xbf66('0x20')]],'as':_0x3d049f['as'],'attributes':_0x3d049f[_0xbf66('0x1d')],'include':_0x3d049f[_0xbf66('0x1f')]?_[_0xbf66('0x1e')](_0x3d049f[_0xbf66('0x1f')],function(_0x4e4b06){return{'model':db[_0x4e4b06[_0xbf66('0x20')]],'as':_0x4e4b06['as'],'attributes':_0x4e4b06[_0xbf66('0x1d')],'include':_0x4e4b06[_0xbf66('0x1f')]?_['map'](_0x4e4b06[_0xbf66('0x1f')],function(_0x308cab){return{'model':db[_0x308cab[_0xbf66('0x20')]],'as':_0x308cab['as'],'attributes':_0x308cab[_0xbf66('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52ce2b){logger['info']('GetOpenchannelQueue',_0x913ec1);logger[_0xbf66('0x14')](_0xbf66('0x21'),_0x913ec1,JSON[_0xbf66('0x15')](_0x52ce2b));_0x509f6e(_0x52ce2b);})[_0xbf66('0x19')](function(_0x219cbd){logger['error'](_0xbf66('0x21'),_0x219cbd[_0xbf66('0x17')],_0x913ec1);_0x59bea4(_0x565ae5[_0xbf66('0x16')](0x1f4,_0x219cbd[_0xbf66('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x1133d3){var _0x4ff5a6=this;return new Promise(function(_0x13b1fd,_0x427b02){return db[_0xbf66('0x1a')][_0xbf66('0x22')]({'raw':_0x1133d3[_0xbf66('0x1b')]?_0x1133d3[_0xbf66('0x1b')][_0xbf66('0x23')]===undefined?!![]:![]:!![],'where':_0x1133d3[_0xbf66('0x1b')]?_0x1133d3[_0xbf66('0x1b')]['where']||null:null,'attributes':_0x1133d3['options']?_0x1133d3[_0xbf66('0x1b')][_0xbf66('0x1d')]||null:null,'include':_0x1133d3[_0xbf66('0x1b')]?_0x1133d3[_0xbf66('0x1b')][_0xbf66('0x1f')]?_['map'](_0x1133d3['options'][_0xbf66('0x1f')],function(_0x13e8a5){return{'model':db[_0x13e8a5[_0xbf66('0x20')]],'as':_0x13e8a5['as'],'attributes':_0x13e8a5['attributes'],'include':_0x13e8a5[_0xbf66('0x1f')]?_[_0xbf66('0x1e')](_0x13e8a5[_0xbf66('0x1f')],function(_0x155b5f){return{'model':db[_0x155b5f[_0xbf66('0x20')]],'as':_0x155b5f['as'],'attributes':_0x155b5f[_0xbf66('0x1d')],'include':_0x155b5f[_0xbf66('0x1f')]?_[_0xbf66('0x1e')](_0x155b5f['include'],function(_0x1d2fe8){return{'model':db[_0x1d2fe8[_0xbf66('0x20')]],'as':_0x1d2fe8['as'],'attributes':_0x1d2fe8[_0xbf66('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bce0a){logger[_0xbf66('0x18')](_0xbf66('0x24'),_0x1133d3);logger[_0xbf66('0x14')](_0xbf66('0x24'),_0x1133d3,JSON[_0xbf66('0x15')](_0x3bce0a));_0x13b1fd(_0x3bce0a);})[_0xbf66('0x19')](function(_0x469099){logger['error'](_0xbf66('0x24'),_0x469099[_0xbf66('0x17')],_0x1133d3);_0x427b02(_0x4ff5a6[_0xbf66('0x16')](0x1f4,_0x469099[_0xbf66('0x17')]));});});};
\ 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