Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / chatQueue / chatQueue.rpc.js
index 4bb4d81..8452eda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7543=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','info','result','catch','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','stringify','find','raw','ShowChatQueue','util','moment','bluebird'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x7543,0xca));var _0x3754=function(_0x4df20d,_0x239ad9){_0x4df20d=_0x4df20d-0x0;var _0x553659=_0x7543[_0x4df20d];return _0x553659;};'use strict';var _=require('lodash');var util=require(_0x3754('0x0'));var moment=require(_0x3754('0x1'));var BPromise=require(_0x3754('0x2'));var rs=require(_0x3754('0x3'));var fs=require('fs');var Redis=require(_0x3754('0x4'));var db=require(_0x3754('0x5'))['db'];var utils=require(_0x3754('0x6'));var logger=require(_0x3754('0x7'))(_0x3754('0x8'));var config=require(_0x3754('0x9'));var jayson=require(_0x3754('0xa'));var client=jayson[_0x3754('0xb')]['http']({'port':0x232a});config[_0x3754('0xc')]=_[_0x3754('0xd')](config[_0x3754('0xc')],{'host':_0x3754('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3754('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x323b21,_0x3efe5b,_0x5210aa){return new BPromise(function(_0x2e92ee,_0x456b40){return client[_0x3754('0xf')](_0x323b21,_0x5210aa)[_0x3754('0x10')](function(_0x77549b){logger['info'](_0x3754('0x11'),_0x3efe5b,'request\x20sent');logger[_0x3754('0x12')](_0x3754('0x13'),_0x3efe5b,_0x3754('0x14'),JSON['stringify'](_0x77549b));if(_0x77549b['error']){if(_0x77549b['error'][_0x3754('0x15')]===0x1f4){logger['error'](_0x3754('0x11'),_0x3efe5b,_0x77549b['error'][_0x3754('0x16')]);return _0x456b40(_0x77549b[_0x3754('0x17')]['message']);}logger[_0x3754('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3efe5b,_0x77549b[_0x3754('0x17')][_0x3754('0x16')]);return _0x2e92ee(_0x77549b[_0x3754('0x17')][_0x3754('0x16')]);}else{logger[_0x3754('0x18')](_0x3754('0x11'),_0x3efe5b,'request\x20sent');_0x2e92ee(_0x77549b[_0x3754('0x19')]['message']);}})[_0x3754('0x1a')](function(_0x52a811){logger[_0x3754('0x17')](_0x3754('0x11'),_0x3efe5b,_0x52a811);_0x456b40(_0x52a811);});});}exports['GetChatQueue']=function(_0x3e6e12){var _0x3562d8=this;return new Promise(function(_0x3149eb,_0x5762cc){return db[_0x3754('0x1b')][_0x3754('0x1c')]({'raw':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')][_0x3754('0x1e')]||null:null,'attributes':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')][_0x3754('0x1f')]||null:null,'limit':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12['options'][_0x3754('0x20')]||null:null,'include':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12['options'][_0x3754('0x21')]?_[_0x3754('0x22')](_0x3e6e12[_0x3754('0x1d')][_0x3754('0x21')],function(_0x132a34){return{'model':db[_0x132a34[_0x3754('0x23')]],'as':_0x132a34['as'],'attributes':_0x132a34[_0x3754('0x1f')],'include':_0x132a34['include']?_[_0x3754('0x22')](_0x132a34[_0x3754('0x21')],function(_0x78f082){return{'model':db[_0x78f082[_0x3754('0x23')]],'as':_0x78f082['as'],'attributes':_0x78f082['attributes'],'include':_0x78f082[_0x3754('0x21')]?_[_0x3754('0x22')](_0x78f082[_0x3754('0x21')],function(_0x27a327){return{'model':db[_0x27a327[_0x3754('0x23')]],'as':_0x27a327['as'],'attributes':_0x27a327[_0x3754('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45215e){logger[_0x3754('0x18')](_0x3754('0x24'),_0x3e6e12);logger[_0x3754('0x12')](_0x3754('0x24'),_0x3e6e12,JSON[_0x3754('0x25')](_0x45215e));_0x3149eb(_0x45215e);})['catch'](function(_0x578958){logger[_0x3754('0x17')](_0x3754('0x24'),_0x578958[_0x3754('0x16')],_0x3e6e12);_0x5762cc(_0x3562d8['error'](0x1f4,_0x578958[_0x3754('0x16')]));});});};exports['ShowChatQueue']=function(_0x198532){var _0x136172=this;return new Promise(function(_0x8b4fc7,_0x2dff32){return db[_0x3754('0x1b')][_0x3754('0x26')]({'raw':_0x198532[_0x3754('0x1d')]?_0x198532['options'][_0x3754('0x27')]===undefined?!![]:![]:!![],'where':_0x198532['options']?_0x198532[_0x3754('0x1d')]['where']||null:null,'attributes':_0x198532[_0x3754('0x1d')]?_0x198532[_0x3754('0x1d')][_0x3754('0x1f')]||null:null,'include':_0x198532[_0x3754('0x1d')]?_0x198532[_0x3754('0x1d')]['include']?_[_0x3754('0x22')](_0x198532[_0x3754('0x1d')][_0x3754('0x21')],function(_0x45bcba){return{'model':db[_0x45bcba[_0x3754('0x23')]],'as':_0x45bcba['as'],'attributes':_0x45bcba[_0x3754('0x1f')],'include':_0x45bcba[_0x3754('0x21')]?_[_0x3754('0x22')](_0x45bcba[_0x3754('0x21')],function(_0xbef4d0){return{'model':db[_0xbef4d0[_0x3754('0x23')]],'as':_0xbef4d0['as'],'attributes':_0xbef4d0['attributes'],'include':_0xbef4d0[_0x3754('0x21')]?_[_0x3754('0x22')](_0xbef4d0[_0x3754('0x21')],function(_0x2d2353){return{'model':db[_0x2d2353[_0x3754('0x23')]],'as':_0x2d2353['as'],'attributes':_0x2d2353[_0x3754('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3754('0x10')](function(_0x988157){logger[_0x3754('0x18')](_0x3754('0x28'),_0x198532);logger[_0x3754('0x12')](_0x3754('0x28'),_0x198532,JSON[_0x3754('0x25')](_0x988157));_0x8b4fc7(_0x988157);})[_0x3754('0x1a')](function(_0x12d4ef){logger['error'](_0x3754('0x28'),_0x12d4ef[_0x3754('0x16')],_0x198532);_0x2dff32(_0x136172[_0x3754('0x17')](0x1f4,_0x12d4ef['message']));});});};
\ No newline at end of file
+var _0xa693=['where','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','ChatQueue','find'];(function(_0x4a2198,_0x2caa94){var _0x50d366=function(_0x35137e){while(--_0x35137e){_0x4a2198['push'](_0x4a2198['shift']());}};_0x50d366(++_0x2caa94);}(_0xa693,0xf1));var _0x3a69=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xa693[_0x38af48];return _0x445384;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});config[_0x3a69('0xb')]=_[_0x3a69('0xc')](config['redis'],{'host':_0x3a69('0xd'),'port':0x18eb});var socket=require(_0x3a69('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x30b7ad,_0x4826b5,_0x68fa91){return new BPromise(function(_0x44b8b2,_0x21142a){return client[_0x3a69('0xf')](_0x30b7ad,_0x68fa91)[_0x3a69('0x10')](function(_0x59f5aa){logger[_0x3a69('0x11')](_0x3a69('0x12'),_0x4826b5,'request\x20sent');logger[_0x3a69('0x13')](_0x3a69('0x14'),_0x4826b5,_0x3a69('0x15'),JSON[_0x3a69('0x16')](_0x59f5aa));if(_0x59f5aa[_0x3a69('0x17')]){if(_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x18')]===0x1f4){logger[_0x3a69('0x17')](_0x3a69('0x12'),_0x4826b5,_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);return _0x21142a(_0x59f5aa[_0x3a69('0x17')]['message']);}logger['error'](_0x3a69('0x12'),_0x4826b5,_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);return _0x44b8b2(_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);}else{logger[_0x3a69('0x11')](_0x3a69('0x12'),_0x4826b5,_0x3a69('0x15'));_0x44b8b2(_0x59f5aa[_0x3a69('0x1a')][_0x3a69('0x19')]);}})['catch'](function(_0x4101ac){logger[_0x3a69('0x17')](_0x3a69('0x12'),_0x4826b5,_0x4101ac);_0x21142a(_0x4101ac);});});}exports['GetChatQueue']=function(_0x3af6c5){var _0x352799=this;return new Promise(function(_0x5090a8,_0x59f565){return db['ChatQueue'][_0x3a69('0x1b')]({'raw':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5['options'][_0x3a69('0x1d')]===undefined?!![]:![]:!![],'where':_0x3af6c5['options']?_0x3af6c5[_0x3a69('0x1c')]['where']||null:null,'attributes':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x1e')]||null:null,'limit':_0x3af6c5['options']?_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x1f')]||null:null,'include':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5['options']['include']?_['map'](_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x20')],function(_0x525019){return{'model':db[_0x525019[_0x3a69('0x21')]],'as':_0x525019['as'],'attributes':_0x525019[_0x3a69('0x1e')],'include':_0x525019[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x525019[_0x3a69('0x20')],function(_0x207ae1){return{'model':db[_0x207ae1['model']],'as':_0x207ae1['as'],'attributes':_0x207ae1[_0x3a69('0x1e')],'include':_0x207ae1[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x207ae1[_0x3a69('0x20')],function(_0x2af120){return{'model':db[_0x2af120[_0x3a69('0x21')]],'as':_0x2af120['as'],'attributes':_0x2af120[_0x3a69('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x586d3f){logger['info'](_0x3a69('0x23'),_0x3af6c5);logger[_0x3a69('0x13')](_0x3a69('0x23'),_0x3af6c5,JSON[_0x3a69('0x16')](_0x586d3f));_0x5090a8(_0x586d3f);})['catch'](function(_0x1bd299){logger[_0x3a69('0x17')]('GetChatQueue',_0x1bd299[_0x3a69('0x19')],_0x3af6c5);_0x59f565(_0x352799[_0x3a69('0x17')](0x1f4,_0x1bd299[_0x3a69('0x19')]));});});};exports[_0x3a69('0x24')]=function(_0x379eff){var _0x33eed8=this;return new Promise(function(_0x34e34b,_0x3cce53){return db[_0x3a69('0x25')][_0x3a69('0x26')]({'raw':_0x379eff[_0x3a69('0x1c')]?_0x379eff['options'][_0x3a69('0x1d')]===undefined?!![]:![]:!![],'where':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x27')]||null:null,'attributes':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x1e')]||null:null,'include':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x20')]?_['map'](_0x379eff[_0x3a69('0x1c')][_0x3a69('0x20')],function(_0x9552ae){return{'model':db[_0x9552ae[_0x3a69('0x21')]],'as':_0x9552ae['as'],'attributes':_0x9552ae[_0x3a69('0x1e')],'include':_0x9552ae[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x9552ae['include'],function(_0x58ff11){return{'model':db[_0x58ff11['model']],'as':_0x58ff11['as'],'attributes':_0x58ff11[_0x3a69('0x1e')],'include':_0x58ff11[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x58ff11[_0x3a69('0x20')],function(_0x8f728b){return{'model':db[_0x8f728b[_0x3a69('0x21')]],'as':_0x8f728b['as'],'attributes':_0x8f728b[_0x3a69('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3a69('0x10')](function(_0xe5a64b){logger[_0x3a69('0x11')](_0x3a69('0x24'),_0x379eff);logger[_0x3a69('0x13')]('ShowChatQueue',_0x379eff,JSON['stringify'](_0xe5a64b));_0x34e34b(_0xe5a64b);})['catch'](function(_0x10820a){logger[_0x3a69('0x17')](_0x3a69('0x24'),_0x10820a[_0x3a69('0x19')],_0x379eff);_0x3cce53(_0x33eed8[_0x3a69('0x17')](0x1f4,_0x10820a['message']));});});};
\ No newline at end of file