Built motion from commit 87cd5f02.|2.5.48
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 9b8f601..d63a346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x122f=['raw','where','attributes','include','map','model','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueue','options'];(function(_0x2cb816,_0x3d444c){var _0x4b4729=function(_0x308c39){while(--_0x308c39){_0x2cb816['push'](_0x2cb816['shift']());}};_0x4b4729(++_0x3d444c);}(_0x122f,0x172));var _0xf122=function(_0x3e6645,_0x2e236d){_0x3e6645=_0x3e6645-0x0;var _0x2eaa0e=_0x122f[_0x3e6645];return _0x2eaa0e;};'use strict';var _=require(_0xf122('0x0'));var util=require(_0xf122('0x1'));var moment=require(_0xf122('0x2'));var BPromise=require(_0xf122('0x3'));var rs=require(_0xf122('0x4'));var fs=require('fs');var Redis=require(_0xf122('0x5'));var db=require(_0xf122('0x6'))['db'];var utils=require(_0xf122('0x7'));var logger=require(_0xf122('0x8'))(_0xf122('0x9'));var config=require(_0xf122('0xa'));var jayson=require(_0xf122('0xb'));var client=jayson[_0xf122('0xc')][_0xf122('0xd')]({'port':0x232a});config[_0xf122('0xe')]=_[_0xf122('0xf')](config[_0xf122('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xf122('0x10')](socket);function respondWithRpcPromise(_0x5cc3dc,_0x373ba9,_0x12523a){return new BPromise(function(_0x27aac8,_0x5807ea){return client[_0xf122('0x11')](_0x5cc3dc,_0x12523a)[_0xf122('0x12')](function(_0x3cef8f){logger[_0xf122('0x13')](_0xf122('0x14'),_0x373ba9,_0xf122('0x15'));logger['debug'](_0xf122('0x16'),_0x373ba9,_0xf122('0x15'),JSON[_0xf122('0x17')](_0x3cef8f));if(_0x3cef8f[_0xf122('0x18')]){if(_0x3cef8f[_0xf122('0x18')][_0xf122('0x19')]===0x1f4){logger[_0xf122('0x18')](_0xf122('0x14'),_0x373ba9,_0x3cef8f['error'][_0xf122('0x1a')]);return _0x5807ea(_0x3cef8f[_0xf122('0x18')]['message']);}logger[_0xf122('0x18')](_0xf122('0x14'),_0x373ba9,_0x3cef8f['error'][_0xf122('0x1a')]);return _0x27aac8(_0x3cef8f[_0xf122('0x18')][_0xf122('0x1a')]);}else{logger['info'](_0xf122('0x14'),_0x373ba9,_0xf122('0x15'));_0x27aac8(_0x3cef8f['result']['message']);}})[_0xf122('0x1b')](function(_0x1b06f9){logger[_0xf122('0x18')](_0xf122('0x14'),_0x373ba9,_0x1b06f9);_0x5807ea(_0x1b06f9);});});}exports['GetOpenchannelQueue']=function(_0x45ea66){var _0x99bf32=this;return new Promise(function(_0x55455d,_0x3b30e9){return db[_0xf122('0x1c')]['findAll']({'raw':_0x45ea66[_0xf122('0x1d')]?_0x45ea66[_0xf122('0x1d')][_0xf122('0x1e')]===undefined?!![]:![]:!![],'where':_0x45ea66[_0xf122('0x1d')]?_0x45ea66[_0xf122('0x1d')][_0xf122('0x1f')]||null:null,'attributes':_0x45ea66[_0xf122('0x1d')]?_0x45ea66[_0xf122('0x1d')][_0xf122('0x20')]||null:null,'limit':_0x45ea66[_0xf122('0x1d')]?_0x45ea66['options']['limit']||null:null,'include':_0x45ea66[_0xf122('0x1d')]?_0x45ea66[_0xf122('0x1d')][_0xf122('0x21')]?_[_0xf122('0x22')](_0x45ea66[_0xf122('0x1d')][_0xf122('0x21')],function(_0x35a588){return{'model':db[_0x35a588['model']],'as':_0x35a588['as'],'attributes':_0x35a588[_0xf122('0x20')],'include':_0x35a588[_0xf122('0x21')]?_[_0xf122('0x22')](_0x35a588[_0xf122('0x21')],function(_0x4fde77){return{'model':db[_0x4fde77[_0xf122('0x23')]],'as':_0x4fde77['as'],'attributes':_0x4fde77[_0xf122('0x20')],'include':_0x4fde77[_0xf122('0x21')]?_['map'](_0x4fde77[_0xf122('0x21')],function(_0x5c7a87){return{'model':db[_0x5c7a87[_0xf122('0x23')]],'as':_0x5c7a87['as'],'attributes':_0x5c7a87[_0xf122('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf122('0x12')](function(_0x2f2eca){logger[_0xf122('0x13')](_0xf122('0x24'),_0x45ea66);logger[_0xf122('0x25')](_0xf122('0x24'),_0x45ea66,JSON[_0xf122('0x17')](_0x2f2eca));_0x55455d(_0x2f2eca);})['catch'](function(_0x3354b4){logger['error'](_0xf122('0x24'),_0x3354b4['message'],_0x45ea66);_0x3b30e9(_0x99bf32['error'](0x1f4,_0x3354b4[_0xf122('0x1a')]));});});};exports[_0xf122('0x26')]=function(_0x4d58a4){var _0xbb831a=this;return new Promise(function(_0x30641d,_0x43c97c){return db[_0xf122('0x1c')][_0xf122('0x27')]({'raw':_0x4d58a4[_0xf122('0x1d')]?_0x4d58a4[_0xf122('0x1d')][_0xf122('0x1e')]===undefined?!![]:![]:!![],'where':_0x4d58a4[_0xf122('0x1d')]?_0x4d58a4['options']['where']||null:null,'attributes':_0x4d58a4['options']?_0x4d58a4[_0xf122('0x1d')]['attributes']||null:null,'include':_0x4d58a4[_0xf122('0x1d')]?_0x4d58a4[_0xf122('0x1d')][_0xf122('0x21')]?_[_0xf122('0x22')](_0x4d58a4[_0xf122('0x1d')]['include'],function(_0x5604ec){return{'model':db[_0x5604ec[_0xf122('0x23')]],'as':_0x5604ec['as'],'attributes':_0x5604ec['attributes'],'include':_0x5604ec[_0xf122('0x21')]?_[_0xf122('0x22')](_0x5604ec[_0xf122('0x21')],function(_0x5ce809){return{'model':db[_0x5ce809[_0xf122('0x23')]],'as':_0x5ce809['as'],'attributes':_0x5ce809['attributes'],'include':_0x5ce809['include']?_[_0xf122('0x22')](_0x5ce809['include'],function(_0x4ae735){return{'model':db[_0x4ae735[_0xf122('0x23')]],'as':_0x4ae735['as'],'attributes':_0x4ae735['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x317997){logger[_0xf122('0x13')]('ShowOpenchannelQueue',_0x4d58a4);logger[_0xf122('0x25')]('ShowOpenchannelQueue',_0x4d58a4,JSON[_0xf122('0x17')](_0x317997));_0x30641d(_0x317997);})[_0xf122('0x1b')](function(_0x269e44){logger[_0xf122('0x18')](_0xf122('0x26'),_0x269e44[_0xf122('0x1a')],_0x4d58a4);_0x43c97c(_0xbb831a['error'](0x1f4,_0x269e44[_0xf122('0x1a')]));});});};
\ No newline at end of file
+var _0x21df=['localhost','socket.io-emitter','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x85c87b,_0x5377a7){var _0x262906=function(_0x5b92b3){while(--_0x5b92b3){_0x85c87b['push'](_0x85c87b['shift']());}};_0x262906(++_0x5377a7);}(_0x21df,0x12b));var _0xf21d=function(_0x21a06a,_0x5be4a5){_0x21a06a=_0x21a06a-0x0;var _0x289657=_0x21df[_0x21a06a];return _0x289657;};'use strict';var _=require(_0xf21d('0x0'));var util=require(_0xf21d('0x1'));var moment=require(_0xf21d('0x2'));var BPromise=require(_0xf21d('0x3'));var rs=require(_0xf21d('0x4'));var fs=require('fs');var Redis=require(_0xf21d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf21d('0x6'));var logger=require(_0xf21d('0x7'))('rpc');var config=require(_0xf21d('0x8'));var jayson=require(_0xf21d('0x9'));var client=jayson[_0xf21d('0xa')]['http']({'port':0x232a});config[_0xf21d('0xb')]=_[_0xf21d('0xc')](config['redis'],{'host':_0xf21d('0xd'),'port':0x18eb});var socket=require(_0xf21d('0xe'))(new Redis(config[_0xf21d('0xb')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x31b1e6,_0x2509ad,_0x1a62ff){return new BPromise(function(_0x38baa5,_0x2354ed){return client[_0xf21d('0xf')](_0x31b1e6,_0x1a62ff)[_0xf21d('0x10')](function(_0x5e9ccb){logger[_0xf21d('0x11')](_0xf21d('0x12'),_0x2509ad,_0xf21d('0x13'));logger[_0xf21d('0x14')](_0xf21d('0x15'),_0x2509ad,'request\x20sent',JSON[_0xf21d('0x16')](_0x5e9ccb));if(_0x5e9ccb[_0xf21d('0x17')]){if(_0x5e9ccb[_0xf21d('0x17')][_0xf21d('0x18')]===0x1f4){logger[_0xf21d('0x17')](_0xf21d('0x12'),_0x2509ad,_0x5e9ccb[_0xf21d('0x17')][_0xf21d('0x19')]);return _0x2354ed(_0x5e9ccb[_0xf21d('0x17')][_0xf21d('0x19')]);}logger['error'](_0xf21d('0x12'),_0x2509ad,_0x5e9ccb[_0xf21d('0x17')]['message']);return _0x38baa5(_0x5e9ccb['error']['message']);}else{logger[_0xf21d('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x2509ad,_0xf21d('0x13'));_0x38baa5(_0x5e9ccb['result'][_0xf21d('0x19')]);}})[_0xf21d('0x1a')](function(_0xbbae2a){logger[_0xf21d('0x17')](_0xf21d('0x12'),_0x2509ad,_0xbbae2a);_0x2354ed(_0xbbae2a);});});}exports[_0xf21d('0x1b')]=function(_0x1053c0){var _0x3666e0=this;return new Promise(function(_0xe16056,_0x2211bd){return db[_0xf21d('0x1c')][_0xf21d('0x1d')]({'raw':_0x1053c0['options']?_0x1053c0[_0xf21d('0x1e')][_0xf21d('0x1f')]===undefined?!![]:![]:!![],'where':_0x1053c0[_0xf21d('0x1e')]?_0x1053c0[_0xf21d('0x1e')][_0xf21d('0x20')]||null:null,'attributes':_0x1053c0[_0xf21d('0x1e')]?_0x1053c0['options'][_0xf21d('0x21')]||null:null,'limit':_0x1053c0['options']?_0x1053c0[_0xf21d('0x1e')][_0xf21d('0x22')]||null:null,'include':_0x1053c0['options']?_0x1053c0[_0xf21d('0x1e')]['include']?_[_0xf21d('0x23')](_0x1053c0[_0xf21d('0x1e')][_0xf21d('0x24')],function(_0x43cdf2){return{'model':db[_0x43cdf2[_0xf21d('0x25')]],'as':_0x43cdf2['as'],'attributes':_0x43cdf2['attributes'],'include':_0x43cdf2[_0xf21d('0x24')]?_['map'](_0x43cdf2[_0xf21d('0x24')],function(_0x7b83d0){return{'model':db[_0x7b83d0[_0xf21d('0x25')]],'as':_0x7b83d0['as'],'attributes':_0x7b83d0[_0xf21d('0x21')],'include':_0x7b83d0['include']?_['map'](_0x7b83d0[_0xf21d('0x24')],function(_0x6dcc86){return{'model':db[_0x6dcc86[_0xf21d('0x25')]],'as':_0x6dcc86['as'],'attributes':_0x6dcc86[_0xf21d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf21d('0x10')](function(_0x3e7e8d){logger[_0xf21d('0x11')](_0xf21d('0x1b'),_0x1053c0);logger[_0xf21d('0x14')](_0xf21d('0x1b'),_0x1053c0,JSON[_0xf21d('0x16')](_0x3e7e8d));_0xe16056(_0x3e7e8d);})[_0xf21d('0x1a')](function(_0x9d081e){logger['error'](_0xf21d('0x1b'),_0x9d081e[_0xf21d('0x19')],_0x1053c0);_0x2211bd(_0x3666e0[_0xf21d('0x17')](0x1f4,_0x9d081e[_0xf21d('0x19')]));});});};exports[_0xf21d('0x26')]=function(_0xc023da){var _0x8d0cdf=this;return new Promise(function(_0x5f68c7,_0x44f9dd){return db[_0xf21d('0x1c')]['find']({'raw':_0xc023da[_0xf21d('0x1e')]?_0xc023da[_0xf21d('0x1e')][_0xf21d('0x1f')]===undefined?!![]:![]:!![],'where':_0xc023da[_0xf21d('0x1e')]?_0xc023da['options']['where']||null:null,'attributes':_0xc023da[_0xf21d('0x1e')]?_0xc023da[_0xf21d('0x1e')]['attributes']||null:null,'include':_0xc023da[_0xf21d('0x1e')]?_0xc023da[_0xf21d('0x1e')][_0xf21d('0x24')]?_[_0xf21d('0x23')](_0xc023da[_0xf21d('0x1e')][_0xf21d('0x24')],function(_0x5a7822){return{'model':db[_0x5a7822[_0xf21d('0x25')]],'as':_0x5a7822['as'],'attributes':_0x5a7822['attributes'],'include':_0x5a7822[_0xf21d('0x24')]?_[_0xf21d('0x23')](_0x5a7822[_0xf21d('0x24')],function(_0x11fd81){return{'model':db[_0x11fd81[_0xf21d('0x25')]],'as':_0x11fd81['as'],'attributes':_0x11fd81[_0xf21d('0x21')],'include':_0x11fd81[_0xf21d('0x24')]?_[_0xf21d('0x23')](_0x11fd81['include'],function(_0x2ab986){return{'model':db[_0x2ab986[_0xf21d('0x25')]],'as':_0x2ab986['as'],'attributes':_0x2ab986[_0xf21d('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e5e50){logger[_0xf21d('0x11')]('ShowOpenchannelQueue',_0xc023da);logger[_0xf21d('0x14')](_0xf21d('0x26'),_0xc023da,JSON['stringify'](_0x4e5e50));_0x5f68c7(_0x4e5e50);})[_0xf21d('0x1a')](function(_0x100f35){logger[_0xf21d('0x17')]('ShowOpenchannelQueue',_0x100f35[_0xf21d('0x19')],_0xc023da);_0x44f9dd(_0x8d0cdf[_0xf21d('0x17')](0x1f4,_0x100f35['message']));});});};
\ No newline at end of file