Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index d0de860..faf9319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb08b=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','ShowOpenchannelQueue','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register'];(function(_0x7acd9c,_0x4ebb68){var _0x4af9d8=function(_0x1e05de){while(--_0x1e05de){_0x7acd9c['push'](_0x7acd9c['shift']());}};_0x4af9d8(++_0x4ebb68);}(_0xb08b,0x1c6));var _0xbb08=function(_0x534c87,_0xcc83cb){_0x534c87=_0x534c87-0x0;var _0x467a74=_0xb08b[_0x534c87];return _0x467a74;};'use strict';var _=require(_0xbb08('0x0'));var util=require('util');var moment=require(_0xbb08('0x1'));var BPromise=require(_0xbb08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb08('0x3'));var db=require(_0xbb08('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb08('0x5'))(_0xbb08('0x6'));var config=require(_0xbb08('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb08('0x8')]({'port':0x232a});config[_0xbb08('0x9')]=_[_0xbb08('0xa')](config[_0xbb08('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb08('0xb'))(new Redis(config[_0xbb08('0x9')]));require(_0xbb08('0xc'))[_0xbb08('0xd')](socket);function respondWithRpcPromise(_0x4af592,_0x36f63f,_0x39dc13){return new BPromise(function(_0x5370f1,_0x228faf){return client[_0xbb08('0xe')](_0x4af592,_0x39dc13)[_0xbb08('0xf')](function(_0x275f40){logger[_0xbb08('0x10')](_0xbb08('0x11'),_0x36f63f,_0xbb08('0x12'));logger[_0xbb08('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x36f63f,'request\x20sent',JSON[_0xbb08('0x14')](_0x275f40));if(_0x275f40[_0xbb08('0x15')]){if(_0x275f40['error'][_0xbb08('0x16')]===0x1f4){logger['error'](_0xbb08('0x11'),_0x36f63f,_0x275f40[_0xbb08('0x15')][_0xbb08('0x17')]);return _0x228faf(_0x275f40[_0xbb08('0x15')][_0xbb08('0x17')]);}logger[_0xbb08('0x15')](_0xbb08('0x11'),_0x36f63f,_0x275f40[_0xbb08('0x15')][_0xbb08('0x17')]);return _0x5370f1(_0x275f40['error'][_0xbb08('0x17')]);}else{logger[_0xbb08('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x36f63f,_0xbb08('0x12'));_0x5370f1(_0x275f40[_0xbb08('0x18')]['message']);}})[_0xbb08('0x19')](function(_0x3a261d){logger[_0xbb08('0x15')](_0xbb08('0x11'),_0x36f63f,_0x3a261d);_0x228faf(_0x3a261d);});});}exports[_0xbb08('0x1a')]=function(_0x4e36a0){var _0x2bad09=this;return new Promise(function(_0x123fe5,_0x1501f8){return db[_0xbb08('0x1b')][_0xbb08('0x1c')]({'raw':_0x4e36a0[_0xbb08('0x1d')]?_0x4e36a0[_0xbb08('0x1d')][_0xbb08('0x1e')]===undefined?!![]:![]:!![],'where':_0x4e36a0[_0xbb08('0x1d')]?_0x4e36a0[_0xbb08('0x1d')][_0xbb08('0x1f')]||null:null,'attributes':_0x4e36a0['options']?_0x4e36a0[_0xbb08('0x1d')]['attributes']||null:null,'limit':_0x4e36a0[_0xbb08('0x1d')]?_0x4e36a0[_0xbb08('0x1d')][_0xbb08('0x20')]||null:null,'include':_0x4e36a0[_0xbb08('0x1d')]?_0x4e36a0[_0xbb08('0x1d')][_0xbb08('0x21')]?_[_0xbb08('0x22')](_0x4e36a0[_0xbb08('0x1d')]['include'],function(_0x360b80){return{'model':db[_0x360b80[_0xbb08('0x23')]],'as':_0x360b80['as'],'attributes':_0x360b80[_0xbb08('0x24')],'include':_0x360b80[_0xbb08('0x21')]?_[_0xbb08('0x22')](_0x360b80[_0xbb08('0x21')],function(_0x3a7396){return{'model':db[_0x3a7396['model']],'as':_0x3a7396['as'],'attributes':_0x3a7396['attributes'],'include':_0x3a7396[_0xbb08('0x21')]?_[_0xbb08('0x22')](_0x3a7396[_0xbb08('0x21')],function(_0x53e72e){return{'model':db[_0x53e72e[_0xbb08('0x23')]],'as':_0x53e72e['as'],'attributes':_0x53e72e[_0xbb08('0x24')]};}):[]};}):[]};}):[]:[]})[_0xbb08('0xf')](function(_0x8d53c4){logger['info'](_0xbb08('0x1a'),_0x4e36a0);logger[_0xbb08('0x13')](_0xbb08('0x1a'),_0x4e36a0,JSON['stringify'](_0x8d53c4));_0x123fe5(_0x8d53c4);})[_0xbb08('0x19')](function(_0x4ed8ea){logger['error'](_0xbb08('0x1a'),_0x4ed8ea[_0xbb08('0x17')],_0x4e36a0);_0x1501f8(_0x2bad09['error'](0x1f4,_0x4ed8ea[_0xbb08('0x17')]));});});};exports[_0xbb08('0x25')]=function(_0x53698e){var _0x5c2568=this;return new Promise(function(_0x2ecfac,_0x37a97d){return db[_0xbb08('0x1b')][_0xbb08('0x26')]({'raw':_0x53698e[_0xbb08('0x1d')]?_0x53698e[_0xbb08('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x53698e['options']?_0x53698e['options'][_0xbb08('0x1f')]||null:null,'attributes':_0x53698e['options']?_0x53698e[_0xbb08('0x1d')][_0xbb08('0x24')]||null:null,'include':_0x53698e['options']?_0x53698e[_0xbb08('0x1d')][_0xbb08('0x21')]?_[_0xbb08('0x22')](_0x53698e[_0xbb08('0x1d')][_0xbb08('0x21')],function(_0x4001c6){return{'model':db[_0x4001c6[_0xbb08('0x23')]],'as':_0x4001c6['as'],'attributes':_0x4001c6[_0xbb08('0x24')],'include':_0x4001c6['include']?_[_0xbb08('0x22')](_0x4001c6[_0xbb08('0x21')],function(_0x25d177){return{'model':db[_0x25d177[_0xbb08('0x23')]],'as':_0x25d177['as'],'attributes':_0x25d177[_0xbb08('0x24')],'include':_0x25d177[_0xbb08('0x21')]?_[_0xbb08('0x22')](_0x25d177[_0xbb08('0x21')],function(_0x3d3137){return{'model':db[_0x3d3137[_0xbb08('0x23')]],'as':_0x3d3137['as'],'attributes':_0x3d3137['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x58e612){logger['info'](_0xbb08('0x25'),_0x53698e);logger[_0xbb08('0x13')](_0xbb08('0x25'),_0x53698e,JSON[_0xbb08('0x14')](_0x58e612));_0x2ecfac(_0x58e612);})[_0xbb08('0x19')](function(_0x1194c7){logger[_0xbb08('0x15')](_0xbb08('0x25'),_0x1194c7['message'],_0x53698e);_0x37a97d(_0x5c2568[_0xbb08('0x15')](0x1f4,_0x1194c7[_0xbb08('0x17')]));});});};
\ No newline at end of file
+var _0xd11c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelQueue,\x20%s,\x20%s','message','catch','OpenchannelQueue','raw','where','options','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find'];(function(_0x5ed789,_0x1c99cf){var _0x2c07d8=function(_0x4d73a7){while(--_0x4d73a7){_0x5ed789['push'](_0x5ed789['shift']());}};_0x2c07d8(++_0x1c99cf);}(_0xd11c,0x197));var _0xcd11=function(_0x3b481b,_0x4b0e9a){_0x3b481b=_0x3b481b-0x0;var _0x156c5d=_0xd11c[_0x3b481b];return _0x156c5d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd11('0x0'));var BPromise=require(_0xcd11('0x1'));var rs=require(_0xcd11('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd11('0x3'))['db'];var utils=require(_0xcd11('0x4'));var logger=require(_0xcd11('0x5'))(_0xcd11('0x6'));var config=require(_0xcd11('0x7'));var jayson=require(_0xcd11('0x8'));var client=jayson['client'][_0xcd11('0x9')]({'port':0x232a});config[_0xcd11('0xa')]=_[_0xcd11('0xb')](config['redis'],{'host':_0xcd11('0xc'),'port':0x18eb});var socket=require(_0xcd11('0xd'))(new Redis(config[_0xcd11('0xa')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2cd3de,_0x11970a,_0xa608af){return new BPromise(function(_0x546e75,_0x5c6f66){return client['request'](_0x2cd3de,_0xa608af)[_0xcd11('0xe')](function(_0x463952){logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,_0xcd11('0x10'));logger[_0xcd11('0x11')](_0xcd11('0x12'),_0x11970a,_0xcd11('0x10'),JSON[_0xcd11('0x13')](_0x463952));if(_0x463952['error']){if(_0x463952['error'][_0xcd11('0x14')]===0x1f4){logger[_0xcd11('0x15')](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x5c6f66(_0x463952[_0xcd11('0x15')]['message']);}logger['error'](_0xcd11('0x16'),_0x11970a,_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);return _0x546e75(_0x463952[_0xcd11('0x15')][_0xcd11('0x17')]);}else{logger[_0xcd11('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x11970a,'request\x20sent');_0x546e75(_0x463952['result'][_0xcd11('0x17')]);}})[_0xcd11('0x18')](function(_0x67ef8a){logger['error'](_0xcd11('0x16'),_0x11970a,_0x67ef8a);_0x5c6f66(_0x67ef8a);});});}exports['GetOpenchannelQueue']=function(_0x327f3c){var _0xd5a744=this;return new Promise(function(_0x1e3679,_0xebd785){return db[_0xcd11('0x19')]['findAll']({'raw':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x327f3c['options']?_0x327f3c['options'][_0xcd11('0x1b')]||null:null,'attributes':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'limit':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1e')]||null:null,'include':_0x327f3c[_0xcd11('0x1c')]?_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x327f3c[_0xcd11('0x1c')][_0xcd11('0x1f')],function(_0x1acaf8){return{'model':db[_0x1acaf8[_0xcd11('0x21')]],'as':_0x1acaf8['as'],'attributes':_0x1acaf8[_0xcd11('0x1d')],'include':_0x1acaf8['include']?_['map'](_0x1acaf8[_0xcd11('0x1f')],function(_0xde8cb6){return{'model':db[_0xde8cb6[_0xcd11('0x21')]],'as':_0xde8cb6['as'],'attributes':_0xde8cb6[_0xcd11('0x1d')],'include':_0xde8cb6[_0xcd11('0x1f')]?_['map'](_0xde8cb6[_0xcd11('0x1f')],function(_0x4f74ad){return{'model':db[_0x4f74ad[_0xcd11('0x21')]],'as':_0x4f74ad['as'],'attributes':_0x4f74ad[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2fc643){logger[_0xcd11('0xf')](_0xcd11('0x22'),_0x327f3c);logger[_0xcd11('0x11')](_0xcd11('0x22'),_0x327f3c,JSON[_0xcd11('0x13')](_0x2fc643));_0x1e3679(_0x2fc643);})['catch'](function(_0x5b414f){logger[_0xcd11('0x15')]('GetOpenchannelQueue',_0x5b414f['message'],_0x327f3c);_0xebd785(_0xd5a744[_0xcd11('0x15')](0x1f4,_0x5b414f[_0xcd11('0x17')]));});});};exports[_0xcd11('0x23')]=function(_0x2c9724){var _0x3ddf9e=this;return new Promise(function(_0x22da5e,_0x27957d){return db[_0xcd11('0x19')][_0xcd11('0x24')]({'raw':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1b')]||null:null,'attributes':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1d')]||null:null,'include':_0x2c9724[_0xcd11('0x1c')]?_0x2c9724[_0xcd11('0x1c')][_0xcd11('0x1f')]?_[_0xcd11('0x20')](_0x2c9724['options'][_0xcd11('0x1f')],function(_0x10b26b){return{'model':db[_0x10b26b[_0xcd11('0x21')]],'as':_0x10b26b['as'],'attributes':_0x10b26b[_0xcd11('0x1d')],'include':_0x10b26b[_0xcd11('0x1f')]?_['map'](_0x10b26b[_0xcd11('0x1f')],function(_0x5b8e6d){return{'model':db[_0x5b8e6d[_0xcd11('0x21')]],'as':_0x5b8e6d['as'],'attributes':_0x5b8e6d[_0xcd11('0x1d')],'include':_0x5b8e6d['include']?_[_0xcd11('0x20')](_0x5b8e6d[_0xcd11('0x1f')],function(_0x191571){return{'model':db[_0x191571[_0xcd11('0x21')]],'as':_0x191571['as'],'attributes':_0x191571[_0xcd11('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcd11('0xe')](function(_0x2308c8){logger[_0xcd11('0xf')](_0xcd11('0x23'),_0x2c9724);logger['debug']('ShowOpenchannelQueue',_0x2c9724,JSON[_0xcd11('0x13')](_0x2308c8));_0x22da5e(_0x2308c8);})[_0xcd11('0x18')](function(_0x3f4904){logger[_0xcd11('0x15')](_0xcd11('0x23'),_0x3f4904['message'],_0x2c9724);_0x27957d(_0x3ddf9e['error'](0x1f4,_0x3f4904[_0xcd11('0x17')]));});});};
\ No newline at end of file