Built motion from commit b5996064.|2.6.21
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 766241b..6b32026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e95=['catch','GetOpenchannelQueue','OpenchannelQueue','raw','options','where','limit','include','map','model','attributes','then','find','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1504bd,_0x39395f){var _0x272dec=function(_0x4c5d85){while(--_0x4c5d85){_0x1504bd['push'](_0x1504bd['shift']());}};_0x272dec(++_0x39395f);}(_0x3e95,0x18a));var _0x53e9=function(_0x49f01f,_0x12a498){_0x49f01f=_0x49f01f-0x0;var _0x28673b=_0x3e95[_0x49f01f];return _0x28673b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x53e9('0x0'));var BPromise=require(_0x53e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53e9('0x2'));var db=require(_0x53e9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x53e9('0x4'))(_0x53e9('0x5'));var config=require(_0x53e9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x53e9('0x7')][_0x53e9('0x8')]({'port':0x232a});config[_0x53e9('0x9')]=_[_0x53e9('0xa')](config[_0x53e9('0x9')],{'host':_0x53e9('0xb'),'port':0x18eb});var socket=require(_0x53e9('0xc'))(new Redis(config[_0x53e9('0x9')]));require('./openchannelQueue.socket')[_0x53e9('0xd')](socket);function respondWithRpcPromise(_0x159d96,_0x1a7172,_0x272206){return new BPromise(function(_0xc783ca,_0x5c55cc){return client['request'](_0x159d96,_0x272206)['then'](function(_0x11734d){logger[_0x53e9('0xe')](_0x53e9('0xf'),_0x1a7172,_0x53e9('0x10'));logger[_0x53e9('0x11')](_0x53e9('0x12'),_0x1a7172,_0x53e9('0x10'),JSON[_0x53e9('0x13')](_0x11734d));if(_0x11734d[_0x53e9('0x14')]){if(_0x11734d['error'][_0x53e9('0x15')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1a7172,_0x11734d[_0x53e9('0x14')]['message']);return _0x5c55cc(_0x11734d[_0x53e9('0x14')][_0x53e9('0x16')]);}logger[_0x53e9('0x14')](_0x53e9('0xf'),_0x1a7172,_0x11734d[_0x53e9('0x14')]['message']);return _0xc783ca(_0x11734d[_0x53e9('0x14')]['message']);}else{logger[_0x53e9('0xe')](_0x53e9('0xf'),_0x1a7172,'request\x20sent');_0xc783ca(_0x11734d[_0x53e9('0x17')][_0x53e9('0x16')]);}})[_0x53e9('0x18')](function(_0x311ebf){logger[_0x53e9('0x14')](_0x53e9('0xf'),_0x1a7172,_0x311ebf);_0x5c55cc(_0x311ebf);});});}exports[_0x53e9('0x19')]=function(_0x5b8af4){var _0x350e5b=this;return new Promise(function(_0x5764ff,_0x5948ae){return db[_0x53e9('0x1a')]['findAll']({'raw':_0x5b8af4['options']?_0x5b8af4['options'][_0x53e9('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b8af4[_0x53e9('0x1c')]?_0x5b8af4[_0x53e9('0x1c')][_0x53e9('0x1d')]||null:null,'attributes':_0x5b8af4[_0x53e9('0x1c')]?_0x5b8af4[_0x53e9('0x1c')]['attributes']||null:null,'limit':_0x5b8af4['options']?_0x5b8af4[_0x53e9('0x1c')][_0x53e9('0x1e')]||null:null,'include':_0x5b8af4[_0x53e9('0x1c')]?_0x5b8af4[_0x53e9('0x1c')][_0x53e9('0x1f')]?_[_0x53e9('0x20')](_0x5b8af4['options'][_0x53e9('0x1f')],function(_0xaad57a){return{'model':db[_0xaad57a[_0x53e9('0x21')]],'as':_0xaad57a['as'],'attributes':_0xaad57a[_0x53e9('0x22')],'include':_0xaad57a[_0x53e9('0x1f')]?_[_0x53e9('0x20')](_0xaad57a[_0x53e9('0x1f')],function(_0x166638){return{'model':db[_0x166638['model']],'as':_0x166638['as'],'attributes':_0x166638['attributes'],'include':_0x166638['include']?_[_0x53e9('0x20')](_0x166638['include'],function(_0x4a2355){return{'model':db[_0x4a2355[_0x53e9('0x21')]],'as':_0x4a2355['as'],'attributes':_0x4a2355[_0x53e9('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53e9('0x23')](function(_0x359cb2){logger[_0x53e9('0xe')](_0x53e9('0x19'),_0x5b8af4);logger[_0x53e9('0x11')]('GetOpenchannelQueue',_0x5b8af4,JSON[_0x53e9('0x13')](_0x359cb2));_0x5764ff(_0x359cb2);})[_0x53e9('0x18')](function(_0x1efcaf){logger[_0x53e9('0x14')]('GetOpenchannelQueue',_0x1efcaf[_0x53e9('0x16')],_0x5b8af4);_0x5948ae(_0x350e5b[_0x53e9('0x14')](0x1f4,_0x1efcaf['message']));});});};exports['ShowOpenchannelQueue']=function(_0x4b6848){var _0xa5fd6d=this;return new Promise(function(_0x24e386,_0x3fc061){return db['OpenchannelQueue'][_0x53e9('0x24')]({'raw':_0x4b6848['options']?_0x4b6848[_0x53e9('0x1c')][_0x53e9('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b6848['options']?_0x4b6848['options']['where']||null:null,'attributes':_0x4b6848[_0x53e9('0x1c')]?_0x4b6848[_0x53e9('0x1c')][_0x53e9('0x22')]||null:null,'include':_0x4b6848[_0x53e9('0x1c')]?_0x4b6848[_0x53e9('0x1c')][_0x53e9('0x1f')]?_['map'](_0x4b6848[_0x53e9('0x1c')][_0x53e9('0x1f')],function(_0x14beba){return{'model':db[_0x14beba[_0x53e9('0x21')]],'as':_0x14beba['as'],'attributes':_0x14beba['attributes'],'include':_0x14beba[_0x53e9('0x1f')]?_[_0x53e9('0x20')](_0x14beba[_0x53e9('0x1f')],function(_0x118594){return{'model':db[_0x118594[_0x53e9('0x21')]],'as':_0x118594['as'],'attributes':_0x118594[_0x53e9('0x22')],'include':_0x118594[_0x53e9('0x1f')]?_[_0x53e9('0x20')](_0x118594[_0x53e9('0x1f')],function(_0xa2635){return{'model':db[_0xa2635[_0x53e9('0x21')]],'as':_0xa2635['as'],'attributes':_0xa2635[_0x53e9('0x22')]};}):[]};}):[]};}):[]:[]})[_0x53e9('0x23')](function(_0x1cde49){logger['info']('ShowOpenchannelQueue',_0x4b6848);logger[_0x53e9('0x11')](_0x53e9('0x25'),_0x4b6848,JSON[_0x53e9('0x13')](_0x1cde49));_0x24e386(_0x1cde49);})[_0x53e9('0x18')](function(_0x2521a2){logger[_0x53e9('0x14')](_0x53e9('0x25'),_0x2521a2['message'],_0x4b6848);_0x3fc061(_0xa5fd6d['error'](0x1f4,_0x2521a2[_0x53e9('0x16')]));});});};
\ No newline at end of file
+var _0x178a=['options','attributes','limit','include','map','model','info','ShowOpenchannelQueue','OpenchannelQueue','raw','where','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','findAll'];(function(_0x4bc100,_0x4b64c0){var _0x55d077=function(_0x52277f){while(--_0x52277f){_0x4bc100['push'](_0x4bc100['shift']());}};_0x55d077(++_0x4b64c0);}(_0x178a,0x162));var _0xa178=function(_0x3ca58f,_0x44e83e){_0x3ca58f=_0x3ca58f-0x0;var _0xceeb54=_0x178a[_0x3ca58f];return _0xceeb54;};'use strict';var _=require('lodash');var util=require(_0xa178('0x0'));var moment=require(_0xa178('0x1'));var BPromise=require('bluebird');var rs=require(_0xa178('0x2'));var fs=require('fs');var Redis=require(_0xa178('0x3'));var db=require(_0xa178('0x4'))['db'];var utils=require(_0xa178('0x5'));var logger=require(_0xa178('0x6'))(_0xa178('0x7'));var config=require(_0xa178('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa178('0x9')]['http']({'port':0x232a});config['redis']=_[_0xa178('0xa')](config[_0xa178('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa178('0xc'))(new Redis(config['redis']));require(_0xa178('0xd'))[_0xa178('0xe')](socket);function respondWithRpcPromise(_0x5afd8c,_0x2c5909,_0x30ce71){return new BPromise(function(_0x20d76a,_0x3d8c96){return client[_0xa178('0xf')](_0x5afd8c,_0x30ce71)[_0xa178('0x10')](function(_0x12dd5c){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x2c5909,_0xa178('0x11'));logger[_0xa178('0x12')](_0xa178('0x13'),_0x2c5909,_0xa178('0x11'),JSON['stringify'](_0x12dd5c));if(_0x12dd5c['error']){if(_0x12dd5c[_0xa178('0x14')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x2c5909,_0x12dd5c[_0xa178('0x14')][_0xa178('0x15')]);return _0x3d8c96(_0x12dd5c['error'][_0xa178('0x15')]);}logger['error'](_0xa178('0x16'),_0x2c5909,_0x12dd5c[_0xa178('0x14')][_0xa178('0x15')]);return _0x20d76a(_0x12dd5c[_0xa178('0x14')][_0xa178('0x15')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x2c5909,_0xa178('0x11'));_0x20d76a(_0x12dd5c['result'][_0xa178('0x15')]);}})[_0xa178('0x17')](function(_0x3b84c0){logger[_0xa178('0x14')](_0xa178('0x16'),_0x2c5909,_0x3b84c0);_0x3d8c96(_0x3b84c0);});});}exports[_0xa178('0x18')]=function(_0x5ecc86){var _0x3c44f4=this;return new Promise(function(_0x436fb6,_0x519839){return db['OpenchannelQueue'][_0xa178('0x19')]({'raw':_0x5ecc86['options']?_0x5ecc86['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ecc86[_0xa178('0x1a')]?_0x5ecc86['options']['where']||null:null,'attributes':_0x5ecc86[_0xa178('0x1a')]?_0x5ecc86['options'][_0xa178('0x1b')]||null:null,'limit':_0x5ecc86[_0xa178('0x1a')]?_0x5ecc86['options'][_0xa178('0x1c')]||null:null,'include':_0x5ecc86[_0xa178('0x1a')]?_0x5ecc86[_0xa178('0x1a')][_0xa178('0x1d')]?_[_0xa178('0x1e')](_0x5ecc86[_0xa178('0x1a')][_0xa178('0x1d')],function(_0x1c0aa0){return{'model':db[_0x1c0aa0['model']],'as':_0x1c0aa0['as'],'attributes':_0x1c0aa0[_0xa178('0x1b')],'include':_0x1c0aa0[_0xa178('0x1d')]?_[_0xa178('0x1e')](_0x1c0aa0[_0xa178('0x1d')],function(_0x1758ad){return{'model':db[_0x1758ad[_0xa178('0x1f')]],'as':_0x1758ad['as'],'attributes':_0x1758ad[_0xa178('0x1b')],'include':_0x1758ad[_0xa178('0x1d')]?_[_0xa178('0x1e')](_0x1758ad[_0xa178('0x1d')],function(_0x3f5337){return{'model':db[_0x3f5337['model']],'as':_0x3f5337['as'],'attributes':_0x3f5337[_0xa178('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa178('0x10')](function(_0x4b4c2f){logger[_0xa178('0x20')](_0xa178('0x18'),_0x5ecc86);logger[_0xa178('0x12')]('GetOpenchannelQueue',_0x5ecc86,JSON['stringify'](_0x4b4c2f));_0x436fb6(_0x4b4c2f);})['catch'](function(_0x59de3d){logger[_0xa178('0x14')](_0xa178('0x18'),_0x59de3d[_0xa178('0x15')],_0x5ecc86);_0x519839(_0x3c44f4[_0xa178('0x14')](0x1f4,_0x59de3d['message']));});});};exports[_0xa178('0x21')]=function(_0xe18e75){var _0x331787=this;return new Promise(function(_0x305f7a,_0x3e7fc5){return db[_0xa178('0x22')]['find']({'raw':_0xe18e75['options']?_0xe18e75[_0xa178('0x1a')][_0xa178('0x23')]===undefined?!![]:![]:!![],'where':_0xe18e75[_0xa178('0x1a')]?_0xe18e75[_0xa178('0x1a')][_0xa178('0x24')]||null:null,'attributes':_0xe18e75[_0xa178('0x1a')]?_0xe18e75[_0xa178('0x1a')][_0xa178('0x1b')]||null:null,'include':_0xe18e75['options']?_0xe18e75['options'][_0xa178('0x1d')]?_[_0xa178('0x1e')](_0xe18e75[_0xa178('0x1a')][_0xa178('0x1d')],function(_0x4d0bbd){return{'model':db[_0x4d0bbd[_0xa178('0x1f')]],'as':_0x4d0bbd['as'],'attributes':_0x4d0bbd[_0xa178('0x1b')],'include':_0x4d0bbd[_0xa178('0x1d')]?_['map'](_0x4d0bbd[_0xa178('0x1d')],function(_0x25e9f3){return{'model':db[_0x25e9f3[_0xa178('0x1f')]],'as':_0x25e9f3['as'],'attributes':_0x25e9f3[_0xa178('0x1b')],'include':_0x25e9f3['include']?_[_0xa178('0x1e')](_0x25e9f3['include'],function(_0x48b112){return{'model':db[_0x48b112[_0xa178('0x1f')]],'as':_0x48b112['as'],'attributes':_0x48b112[_0xa178('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa178('0x10')](function(_0x266503){logger[_0xa178('0x20')](_0xa178('0x21'),_0xe18e75);logger[_0xa178('0x12')](_0xa178('0x21'),_0xe18e75,JSON[_0xa178('0x25')](_0x266503));_0x305f7a(_0x266503);})['catch'](function(_0x134253){logger[_0xa178('0x14')](_0xa178('0x21'),_0x134253[_0xa178('0x15')],_0xe18e75);_0x3e7fc5(_0x331787[_0xa178('0x14')](0x1f4,_0x134253['message']));});});};
\ No newline at end of file