Built motion from commit 53172ac8.|2.6.30
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index 0cd5b6d..0952827 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c0c=['catch','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','stringify','ShowOpenchannelQueue','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c0c,0x140));var _0xc2c0=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x2c0c[_0x72895a];return _0x5226d5;};'use strict';var _=require(_0xc2c0('0x0'));var util=require(_0xc2c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc2c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2c0('0x3'))['db'];var utils=require(_0xc2c0('0x4'));var logger=require(_0xc2c0('0x5'))(_0xc2c0('0x6'));var config=require('../../config/environment');var jayson=require(_0xc2c0('0x7'));var client=jayson[_0xc2c0('0x8')]['http']({'port':0x232a});config[_0xc2c0('0x9')]=_[_0xc2c0('0xa')](config[_0xc2c0('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2c0('0xb'))(new Redis(config[_0xc2c0('0x9')]));require(_0xc2c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x37474a,_0x3821de,_0x1701e4){return new BPromise(function(_0x36a5e4,_0x33ee4c){return client[_0xc2c0('0xd')](_0x37474a,_0x1701e4)[_0xc2c0('0xe')](function(_0x32cfcb){logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3821de,_0xc2c0('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3821de,'request\x20sent',JSON['stringify'](_0x32cfcb));if(_0x32cfcb[_0xc2c0('0x12')]){if(_0x32cfcb[_0xc2c0('0x12')]['code']===0x1f4){logger[_0xc2c0('0x12')](_0xc2c0('0x10'),_0x3821de,_0x32cfcb[_0xc2c0('0x12')][_0xc2c0('0x13')]);return _0x33ee4c(_0x32cfcb[_0xc2c0('0x12')]['message']);}logger[_0xc2c0('0x12')](_0xc2c0('0x10'),_0x3821de,_0x32cfcb[_0xc2c0('0x12')]['message']);return _0x36a5e4(_0x32cfcb['error'][_0xc2c0('0x13')]);}else{logger[_0xc2c0('0xf')](_0xc2c0('0x10'),_0x3821de,_0xc2c0('0x11'));_0x36a5e4(_0x32cfcb['result'][_0xc2c0('0x13')]);}})[_0xc2c0('0x14')](function(_0x18536b){logger['error'](_0xc2c0('0x10'),_0x3821de,_0x18536b);_0x33ee4c(_0x18536b);});});}exports['GetOpenchannelQueue']=function(_0x18b691){var _0x4661d9=this;return new Promise(function(_0x1dff00,_0x3f41eb){return db[_0xc2c0('0x15')][_0xc2c0('0x16')]({'raw':_0x18b691[_0xc2c0('0x17')]?_0x18b691[_0xc2c0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x18b691['options']?_0x18b691[_0xc2c0('0x17')][_0xc2c0('0x18')]||null:null,'attributes':_0x18b691['options']?_0x18b691[_0xc2c0('0x17')][_0xc2c0('0x19')]||null:null,'limit':_0x18b691[_0xc2c0('0x17')]?_0x18b691[_0xc2c0('0x17')][_0xc2c0('0x1a')]||null:null,'include':_0x18b691[_0xc2c0('0x17')]?_0x18b691[_0xc2c0('0x17')][_0xc2c0('0x1b')]?_[_0xc2c0('0x1c')](_0x18b691['options'][_0xc2c0('0x1b')],function(_0x13c593){return{'model':db[_0x13c593['model']],'as':_0x13c593['as'],'attributes':_0x13c593[_0xc2c0('0x19')],'include':_0x13c593[_0xc2c0('0x1b')]?_[_0xc2c0('0x1c')](_0x13c593[_0xc2c0('0x1b')],function(_0x1acb2d){return{'model':db[_0x1acb2d[_0xc2c0('0x1d')]],'as':_0x1acb2d['as'],'attributes':_0x1acb2d[_0xc2c0('0x19')],'include':_0x1acb2d[_0xc2c0('0x1b')]?_[_0xc2c0('0x1c')](_0x1acb2d[_0xc2c0('0x1b')],function(_0x4eded5){return{'model':db[_0x4eded5['model']],'as':_0x4eded5['as'],'attributes':_0x4eded5[_0xc2c0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ad873){logger[_0xc2c0('0xf')](_0xc2c0('0x1e'),_0x18b691);logger[_0xc2c0('0x1f')](_0xc2c0('0x1e'),_0x18b691,JSON[_0xc2c0('0x20')](_0x1ad873));_0x1dff00(_0x1ad873);})[_0xc2c0('0x14')](function(_0x1fd7aa){logger[_0xc2c0('0x12')](_0xc2c0('0x1e'),_0x1fd7aa['message'],_0x18b691);_0x3f41eb(_0x4661d9[_0xc2c0('0x12')](0x1f4,_0x1fd7aa[_0xc2c0('0x13')]));});});};exports[_0xc2c0('0x21')]=function(_0x230f17){var _0x1649bf=this;return new Promise(function(_0x9a8eca,_0x1b58f3){return db[_0xc2c0('0x15')]['find']({'raw':_0x230f17[_0xc2c0('0x17')]?_0x230f17[_0xc2c0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x230f17['options']?_0x230f17[_0xc2c0('0x17')][_0xc2c0('0x18')]||null:null,'attributes':_0x230f17[_0xc2c0('0x17')]?_0x230f17[_0xc2c0('0x17')]['attributes']||null:null,'include':_0x230f17[_0xc2c0('0x17')]?_0x230f17[_0xc2c0('0x17')]['include']?_[_0xc2c0('0x1c')](_0x230f17[_0xc2c0('0x17')]['include'],function(_0x521948){return{'model':db[_0x521948['model']],'as':_0x521948['as'],'attributes':_0x521948['attributes'],'include':_0x521948[_0xc2c0('0x1b')]?_[_0xc2c0('0x1c')](_0x521948['include'],function(_0x3f7153){return{'model':db[_0x3f7153[_0xc2c0('0x1d')]],'as':_0x3f7153['as'],'attributes':_0x3f7153[_0xc2c0('0x19')],'include':_0x3f7153[_0xc2c0('0x1b')]?_[_0xc2c0('0x1c')](_0x3f7153[_0xc2c0('0x1b')],function(_0x3126cc){return{'model':db[_0x3126cc['model']],'as':_0x3126cc['as'],'attributes':_0x3126cc[_0xc2c0('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc2c0('0xe')](function(_0x2ff51a){logger[_0xc2c0('0xf')](_0xc2c0('0x21'),_0x230f17);logger[_0xc2c0('0x1f')](_0xc2c0('0x21'),_0x230f17,JSON[_0xc2c0('0x20')](_0x2ff51a));_0x9a8eca(_0x2ff51a);})['catch'](function(_0x109ed1){logger[_0xc2c0('0x12')](_0xc2c0('0x21'),_0x109ed1['message'],_0x230f17);_0x1b58f3(_0x1649bf[_0xc2c0('0x12')](0x1f4,_0x109ed1['message']));});});};
\ No newline at end of file
+var _0xd4b0=['find','where','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelQueue','findAll','options','raw','attributes','limit','include','model','map','then','info','GetOpenchannelQueue','ShowOpenchannelQueue'];(function(_0x46e730,_0x402751){var _0x1e6c92=function(_0x1635e8){while(--_0x1635e8){_0x46e730['push'](_0x46e730['shift']());}};_0x1e6c92(++_0x402751);}(_0xd4b0,0x162));var _0x0d4b=function(_0x5806fa,_0x37a422){_0x5806fa=_0x5806fa-0x0;var _0x4c74d2=_0xd4b0[_0x5806fa];return _0x4c74d2;};'use strict';var _=require(_0x0d4b('0x0'));var util=require('util');var moment=require(_0x0d4b('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d4b('0x2'));var fs=require('fs');var Redis=require(_0x0d4b('0x3'));var db=require(_0x0d4b('0x4'))['db'];var utils=require(_0x0d4b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0d4b('0x6'));var jayson=require(_0x0d4b('0x7'));var client=jayson[_0x0d4b('0x8')]['http']({'port':0x232a});config[_0x0d4b('0x9')]=_[_0x0d4b('0xa')](config[_0x0d4b('0x9')],{'host':_0x0d4b('0xb'),'port':0x18eb});var socket=require(_0x0d4b('0xc'))(new Redis(config[_0x0d4b('0x9')]));require('./openchannelQueue.socket')[_0x0d4b('0xd')](socket);function respondWithRpcPromise(_0x46119e,_0x520b37,_0x2b3bc0){return new BPromise(function(_0x131651,_0x140758){return client['request'](_0x46119e,_0x2b3bc0)['then'](function(_0x3126e9){logger['info'](_0x0d4b('0xe'),_0x520b37,_0x0d4b('0xf'));logger[_0x0d4b('0x10')](_0x0d4b('0x11'),_0x520b37,_0x0d4b('0xf'),JSON[_0x0d4b('0x12')](_0x3126e9));if(_0x3126e9[_0x0d4b('0x13')]){if(_0x3126e9[_0x0d4b('0x13')][_0x0d4b('0x14')]===0x1f4){logger['error'](_0x0d4b('0xe'),_0x520b37,_0x3126e9['error'][_0x0d4b('0x15')]);return _0x140758(_0x3126e9['error']['message']);}logger[_0x0d4b('0x13')](_0x0d4b('0xe'),_0x520b37,_0x3126e9[_0x0d4b('0x13')]['message']);return _0x131651(_0x3126e9[_0x0d4b('0x13')][_0x0d4b('0x15')]);}else{logger['info'](_0x0d4b('0xe'),_0x520b37,_0x0d4b('0xf'));_0x131651(_0x3126e9[_0x0d4b('0x16')][_0x0d4b('0x15')]);}})['catch'](function(_0x12175d){logger[_0x0d4b('0x13')](_0x0d4b('0xe'),_0x520b37,_0x12175d);_0x140758(_0x12175d);});});}exports['GetOpenchannelQueue']=function(_0x94184d){var _0x24652a=this;return new Promise(function(_0x294246,_0x41cfca){return db[_0x0d4b('0x17')][_0x0d4b('0x18')]({'raw':_0x94184d[_0x0d4b('0x19')]?_0x94184d[_0x0d4b('0x19')][_0x0d4b('0x1a')]===undefined?!![]:![]:!![],'where':_0x94184d[_0x0d4b('0x19')]?_0x94184d[_0x0d4b('0x19')]['where']||null:null,'attributes':_0x94184d[_0x0d4b('0x19')]?_0x94184d[_0x0d4b('0x19')][_0x0d4b('0x1b')]||null:null,'limit':_0x94184d['options']?_0x94184d[_0x0d4b('0x19')][_0x0d4b('0x1c')]||null:null,'include':_0x94184d[_0x0d4b('0x19')]?_0x94184d[_0x0d4b('0x19')][_0x0d4b('0x1d')]?_['map'](_0x94184d[_0x0d4b('0x19')][_0x0d4b('0x1d')],function(_0x3bcd30){return{'model':db[_0x3bcd30[_0x0d4b('0x1e')]],'as':_0x3bcd30['as'],'attributes':_0x3bcd30[_0x0d4b('0x1b')],'include':_0x3bcd30['include']?_[_0x0d4b('0x1f')](_0x3bcd30['include'],function(_0x5973c5){return{'model':db[_0x5973c5[_0x0d4b('0x1e')]],'as':_0x5973c5['as'],'attributes':_0x5973c5[_0x0d4b('0x1b')],'include':_0x5973c5[_0x0d4b('0x1d')]?_[_0x0d4b('0x1f')](_0x5973c5[_0x0d4b('0x1d')],function(_0x347301){return{'model':db[_0x347301[_0x0d4b('0x1e')]],'as':_0x347301['as'],'attributes':_0x347301[_0x0d4b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d4b('0x20')](function(_0x3a6810){logger[_0x0d4b('0x21')](_0x0d4b('0x22'),_0x94184d);logger['debug'](_0x0d4b('0x22'),_0x94184d,JSON['stringify'](_0x3a6810));_0x294246(_0x3a6810);})['catch'](function(_0x4967ca){logger[_0x0d4b('0x13')](_0x0d4b('0x22'),_0x4967ca[_0x0d4b('0x15')],_0x94184d);_0x41cfca(_0x24652a[_0x0d4b('0x13')](0x1f4,_0x4967ca[_0x0d4b('0x15')]));});});};exports[_0x0d4b('0x23')]=function(_0x509227){var _0x333606=this;return new Promise(function(_0x555590,_0x53d6e1){return db[_0x0d4b('0x17')][_0x0d4b('0x24')]({'raw':_0x509227[_0x0d4b('0x19')]?_0x509227[_0x0d4b('0x19')][_0x0d4b('0x1a')]===undefined?!![]:![]:!![],'where':_0x509227[_0x0d4b('0x19')]?_0x509227['options'][_0x0d4b('0x25')]||null:null,'attributes':_0x509227[_0x0d4b('0x19')]?_0x509227[_0x0d4b('0x19')]['attributes']||null:null,'include':_0x509227[_0x0d4b('0x19')]?_0x509227[_0x0d4b('0x19')][_0x0d4b('0x1d')]?_['map'](_0x509227[_0x0d4b('0x19')][_0x0d4b('0x1d')],function(_0x1c334d){return{'model':db[_0x1c334d[_0x0d4b('0x1e')]],'as':_0x1c334d['as'],'attributes':_0x1c334d['attributes'],'include':_0x1c334d[_0x0d4b('0x1d')]?_[_0x0d4b('0x1f')](_0x1c334d[_0x0d4b('0x1d')],function(_0x36c585){return{'model':db[_0x36c585[_0x0d4b('0x1e')]],'as':_0x36c585['as'],'attributes':_0x36c585[_0x0d4b('0x1b')],'include':_0x36c585[_0x0d4b('0x1d')]?_[_0x0d4b('0x1f')](_0x36c585['include'],function(_0x41e58c){return{'model':db[_0x41e58c[_0x0d4b('0x1e')]],'as':_0x41e58c['as'],'attributes':_0x41e58c[_0x0d4b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0d4b('0x20')](function(_0x4b253b){logger[_0x0d4b('0x21')](_0x0d4b('0x23'),_0x509227);logger[_0x0d4b('0x10')](_0x0d4b('0x23'),_0x509227,JSON[_0x0d4b('0x12')](_0x4b253b));_0x555590(_0x4b253b);})[_0x0d4b('0x26')](function(_0x3b0068){logger['error']('ShowOpenchannelQueue',_0x3b0068[_0x0d4b('0x15')],_0x509227);_0x53d6e1(_0x333606[_0x0d4b('0x13')](0x1f4,_0x3b0068['message']));});});};
\ No newline at end of file