Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index a36b1ca..e6b0ed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14f6=['message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowOpenchannelQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x288fb8,_0x3606df){var _0x8f14b5=function(_0x4839d3){while(--_0x4839d3){_0x288fb8['push'](_0x288fb8['shift']());}};_0x8f14b5(++_0x3606df);}(_0x14f6,0x1d8));var _0x614f=function(_0x1ba717,_0xb9193a){_0x1ba717=_0x1ba717-0x0;var _0x208f52=_0x14f6[_0x1ba717];return _0x208f52;};'use strict';var _=require(_0x614f('0x0'));var util=require(_0x614f('0x1'));var moment=require('moment');var BPromise=require(_0x614f('0x2'));var rs=require(_0x614f('0x3'));var fs=require('fs');var Redis=require(_0x614f('0x4'));var db=require(_0x614f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x614f('0x6'))(_0x614f('0x7'));var config=require(_0x614f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x614f('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x614f('0xa')]));require(_0x614f('0xb'))[_0x614f('0xc')](socket);function respondWithRpcPromise(_0x53954a,_0x13ce93,_0x4774ec){return new BPromise(function(_0x24953d,_0x2ce3d6){return client[_0x614f('0xd')](_0x53954a,_0x4774ec)['then'](function(_0x25449f){logger[_0x614f('0xe')](_0x614f('0xf'),_0x13ce93,_0x614f('0x10'));logger[_0x614f('0x11')](_0x614f('0x12'),_0x13ce93,_0x614f('0x10'),JSON[_0x614f('0x13')](_0x25449f));if(_0x25449f[_0x614f('0x14')]){if(_0x25449f[_0x614f('0x14')][_0x614f('0x15')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x13ce93,_0x25449f[_0x614f('0x14')][_0x614f('0x16')]);return _0x2ce3d6(_0x25449f['error']['message']);}logger[_0x614f('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x13ce93,_0x25449f[_0x614f('0x14')]['message']);return _0x24953d(_0x25449f[_0x614f('0x14')]['message']);}else{logger['info'](_0x614f('0xf'),_0x13ce93,_0x614f('0x10'));_0x24953d(_0x25449f[_0x614f('0x17')][_0x614f('0x16')]);}})[_0x614f('0x18')](function(_0x5a7b09){logger[_0x614f('0x14')](_0x614f('0xf'),_0x13ce93,_0x5a7b09);_0x2ce3d6(_0x5a7b09);});});}exports[_0x614f('0x19')]=function(_0x2e0ba6){var _0x5cadc6=this;return new Promise(function(_0x4be7e8,_0x37f216){return db[_0x614f('0x1a')][_0x614f('0x1b')]({'raw':_0x2e0ba6[_0x614f('0x1c')]?_0x2e0ba6['options'][_0x614f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e0ba6[_0x614f('0x1c')]?_0x2e0ba6['options'][_0x614f('0x1e')]||null:null,'attributes':_0x2e0ba6['options']?_0x2e0ba6[_0x614f('0x1c')][_0x614f('0x1f')]||null:null,'limit':_0x2e0ba6['options']?_0x2e0ba6['options']['limit']||null:null,'include':_0x2e0ba6['options']?_0x2e0ba6['options'][_0x614f('0x20')]?_[_0x614f('0x21')](_0x2e0ba6[_0x614f('0x1c')][_0x614f('0x20')],function(_0x47e7f6){return{'model':db[_0x47e7f6['model']],'as':_0x47e7f6['as'],'attributes':_0x47e7f6[_0x614f('0x1f')],'include':_0x47e7f6[_0x614f('0x20')]?_[_0x614f('0x21')](_0x47e7f6['include'],function(_0x355f0d){return{'model':db[_0x355f0d['model']],'as':_0x355f0d['as'],'attributes':_0x355f0d[_0x614f('0x1f')],'include':_0x355f0d[_0x614f('0x20')]?_[_0x614f('0x21')](_0x355f0d[_0x614f('0x20')],function(_0x5053f3){return{'model':db[_0x5053f3[_0x614f('0x22')]],'as':_0x5053f3['as'],'attributes':_0x5053f3['attributes']};}):[]};}):[]};}):[]:[]})[_0x614f('0x23')](function(_0x2586cf){logger[_0x614f('0xe')](_0x614f('0x19'),_0x2e0ba6);logger[_0x614f('0x11')](_0x614f('0x19'),_0x2e0ba6,JSON[_0x614f('0x13')](_0x2586cf));_0x4be7e8(_0x2586cf);})['catch'](function(_0x674eb0){logger[_0x614f('0x14')](_0x614f('0x19'),_0x674eb0['message'],_0x2e0ba6);_0x37f216(_0x5cadc6[_0x614f('0x14')](0x1f4,_0x674eb0['message']));});});};exports[_0x614f('0x24')]=function(_0x47a844){var _0x1a288b=this;return new Promise(function(_0x366d52,_0x4acbb9){return db[_0x614f('0x1a')][_0x614f('0x25')]({'raw':_0x47a844[_0x614f('0x1c')]?_0x47a844['options']['raw']===undefined?!![]:![]:!![],'where':_0x47a844[_0x614f('0x1c')]?_0x47a844[_0x614f('0x1c')][_0x614f('0x1e')]||null:null,'attributes':_0x47a844['options']?_0x47a844[_0x614f('0x1c')][_0x614f('0x1f')]||null:null,'include':_0x47a844[_0x614f('0x1c')]?_0x47a844[_0x614f('0x1c')]['include']?_[_0x614f('0x21')](_0x47a844[_0x614f('0x1c')][_0x614f('0x20')],function(_0x467e3c){return{'model':db[_0x467e3c[_0x614f('0x22')]],'as':_0x467e3c['as'],'attributes':_0x467e3c[_0x614f('0x1f')],'include':_0x467e3c[_0x614f('0x20')]?_[_0x614f('0x21')](_0x467e3c['include'],function(_0x441eb3){return{'model':db[_0x441eb3[_0x614f('0x22')]],'as':_0x441eb3['as'],'attributes':_0x441eb3[_0x614f('0x1f')],'include':_0x441eb3[_0x614f('0x20')]?_[_0x614f('0x21')](_0x441eb3[_0x614f('0x20')],function(_0x2a34c9){return{'model':db[_0x2a34c9[_0x614f('0x22')]],'as':_0x2a34c9['as'],'attributes':_0x2a34c9[_0x614f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x614f('0x23')](function(_0x2e1ff9){logger[_0x614f('0xe')](_0x614f('0x24'),_0x47a844);logger[_0x614f('0x11')](_0x614f('0x24'),_0x47a844,JSON[_0x614f('0x13')](_0x2e1ff9));_0x366d52(_0x2e1ff9);})[_0x614f('0x18')](function(_0x350ad6){logger['error'](_0x614f('0x24'),_0x350ad6['message'],_0x47a844);_0x4acbb9(_0x1a288b[_0x614f('0x14')](0x1f4,_0x350ad6['message']));});});};
\ No newline at end of file
+var _0x9c5b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','catch','findAll','raw','options','where','attributes','include','map','model','GetOpenchannelQueue','debug','stringify','ShowOpenchannelQueue','OpenchannelQueue','lodash','moment','bluebird','randomstring'];(function(_0xa164df,_0x5d69eb){var _0x29b157=function(_0x3e601d){while(--_0x3e601d){_0xa164df['push'](_0xa164df['shift']());}};_0x29b157(++_0x5d69eb);}(_0x9c5b,0x1d0));var _0xb9c5=function(_0x3e3f27,_0x2c2ecf){_0x3e3f27=_0x3e3f27-0x0;var _0x15c868=_0x9c5b[_0x3e3f27];return _0x15c868;};'use strict';var _=require(_0xb9c5('0x0'));var util=require('util');var moment=require(_0xb9c5('0x1'));var BPromise=require(_0xb9c5('0x2'));var rs=require(_0xb9c5('0x3'));var fs=require('fs');var Redis=require(_0xb9c5('0x4'));var db=require(_0xb9c5('0x5'))['db'];var utils=require(_0xb9c5('0x6'));var logger=require(_0xb9c5('0x7'))(_0xb9c5('0x8'));var config=require('../../config/environment');var jayson=require(_0xb9c5('0x9'));var client=jayson['client'][_0xb9c5('0xa')]({'port':0x232a});config[_0xb9c5('0xb')]=_[_0xb9c5('0xc')](config[_0xb9c5('0xb')],{'host':_0xb9c5('0xd'),'port':0x18eb});var socket=require(_0xb9c5('0xe'))(new Redis(config[_0xb9c5('0xb')]));require(_0xb9c5('0xf'))['register'](socket);function respondWithRpcPromise(_0x4e71df,_0x220fca,_0x5e1187){return new BPromise(function(_0x3d1a8f,_0x1c5f2f){return client[_0xb9c5('0x10')](_0x4e71df,_0x5e1187)[_0xb9c5('0x11')](function(_0x4251ef){logger[_0xb9c5('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0xb9c5('0x13'));logger['debug'](_0xb9c5('0x14'),_0x220fca,_0xb9c5('0x13'),JSON['stringify'](_0x4251ef));if(_0x4251ef[_0xb9c5('0x15')]){if(_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x16')]===0x1f4){logger['error'](_0xb9c5('0x17'),_0x220fca,_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x18')]);return _0x1c5f2f(_0x4251ef['error']['message']);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0x4251ef[_0xb9c5('0x15')][_0xb9c5('0x18')]);return _0x3d1a8f(_0x4251ef[_0xb9c5('0x15')]['message']);}else{logger['info'](_0xb9c5('0x17'),_0x220fca,'request\x20sent');_0x3d1a8f(_0x4251ef['result'][_0xb9c5('0x18')]);}})[_0xb9c5('0x19')](function(_0x284a85){logger[_0xb9c5('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x220fca,_0x284a85);_0x1c5f2f(_0x284a85);});});}exports['GetOpenchannelQueue']=function(_0x2ffbaf){var _0x431ea2=this;return new Promise(function(_0x19c5ab,_0x28d089){return db['OpenchannelQueue'][_0xb9c5('0x1a')]({'raw':_0x2ffbaf['options']?_0x2ffbaf['options'][_0xb9c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf['options'][_0xb9c5('0x1d')]||null:null,'attributes':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf[_0xb9c5('0x1c')][_0xb9c5('0x1e')]||null:null,'limit':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf[_0xb9c5('0x1c')]['limit']||null:null,'include':_0x2ffbaf[_0xb9c5('0x1c')]?_0x2ffbaf['options'][_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x2ffbaf['options'][_0xb9c5('0x1f')],function(_0x23452d){return{'model':db[_0x23452d['model']],'as':_0x23452d['as'],'attributes':_0x23452d[_0xb9c5('0x1e')],'include':_0x23452d['include']?_[_0xb9c5('0x20')](_0x23452d[_0xb9c5('0x1f')],function(_0x2d2973){return{'model':db[_0x2d2973[_0xb9c5('0x21')]],'as':_0x2d2973['as'],'attributes':_0x2d2973['attributes'],'include':_0x2d2973[_0xb9c5('0x1f')]?_['map'](_0x2d2973[_0xb9c5('0x1f')],function(_0x13366c){return{'model':db[_0x13366c['model']],'as':_0x13366c['as'],'attributes':_0x13366c[_0xb9c5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb9c5('0x11')](function(_0x2fc408){logger[_0xb9c5('0x12')](_0xb9c5('0x22'),_0x2ffbaf);logger[_0xb9c5('0x23')](_0xb9c5('0x22'),_0x2ffbaf,JSON[_0xb9c5('0x24')](_0x2fc408));_0x19c5ab(_0x2fc408);})[_0xb9c5('0x19')](function(_0xa7a014){logger['error'](_0xb9c5('0x22'),_0xa7a014[_0xb9c5('0x18')],_0x2ffbaf);_0x28d089(_0x431ea2[_0xb9c5('0x15')](0x1f4,_0xa7a014[_0xb9c5('0x18')]));});});};exports[_0xb9c5('0x25')]=function(_0x241cb0){var _0x33550a=this;return new Promise(function(_0x1eff05,_0x923dc){return db[_0xb9c5('0x26')]['find']({'raw':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0['options'][_0xb9c5('0x1d')]||null:null,'attributes':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1e')]||null:null,'include':_0x241cb0[_0xb9c5('0x1c')]?_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1f')]?_['map'](_0x241cb0[_0xb9c5('0x1c')][_0xb9c5('0x1f')],function(_0x3f8564){return{'model':db[_0x3f8564[_0xb9c5('0x21')]],'as':_0x3f8564['as'],'attributes':_0x3f8564[_0xb9c5('0x1e')],'include':_0x3f8564[_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x3f8564[_0xb9c5('0x1f')],function(_0x30d4ba){return{'model':db[_0x30d4ba['model']],'as':_0x30d4ba['as'],'attributes':_0x30d4ba[_0xb9c5('0x1e')],'include':_0x30d4ba[_0xb9c5('0x1f')]?_[_0xb9c5('0x20')](_0x30d4ba['include'],function(_0x3871a4){return{'model':db[_0x3871a4['model']],'as':_0x3871a4['as'],'attributes':_0x3871a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9c5('0x11')](function(_0x55b406){logger[_0xb9c5('0x12')](_0xb9c5('0x25'),_0x241cb0);logger['debug'](_0xb9c5('0x25'),_0x241cb0,JSON['stringify'](_0x55b406));_0x1eff05(_0x55b406);})[_0xb9c5('0x19')](function(_0xf86b8f){logger[_0xb9c5('0x15')]('ShowOpenchannelQueue',_0xf86b8f[_0xb9c5('0x18')],_0x241cb0);_0x923dc(_0x33550a[_0xb9c5('0x15')](0x1f4,_0xf86b8f[_0xb9c5('0x18')]));});});};
\ No newline at end of file