Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / api / chatQueue / chatQueue.rpc.js
index 2e25410..bc2ab4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf79b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','ShowChatQueue','find','where','util','moment','randomstring','ioredis'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf79b,0xa0));var _0xbf79=function(_0x22edf2,_0x215181){_0x22edf2=_0x22edf2-0x0;var _0x22b866=_0xf79b[_0x22edf2];return _0x22b866;};'use strict';var _=require('lodash');var util=require(_0xbf79('0x0'));var moment=require(_0xbf79('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf79('0x2'));var fs=require('fs');var Redis=require(_0xbf79('0x3'));var db=require(_0xbf79('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf79('0x5'))(_0xbf79('0x6'));var config=require(_0xbf79('0x7'));var jayson=require(_0xbf79('0x8'));var client=jayson[_0xbf79('0x9')][_0xbf79('0xa')]({'port':0x232a});config[_0xbf79('0xb')]=_[_0xbf79('0xc')](config['redis'],{'host':_0xbf79('0xd'),'port':0x18eb});var socket=require(_0xbf79('0xe'))(new Redis(config['redis']));require(_0xbf79('0xf'))['register'](socket);function respondWithRpcPromise(_0x2be4f4,_0x5211fa,_0x358b46){return new BPromise(function(_0x53ca23,_0x484dae){return client[_0xbf79('0x10')](_0x2be4f4,_0x358b46)[_0xbf79('0x11')](function(_0x37b698){logger[_0xbf79('0x12')](_0xbf79('0x13'),_0x5211fa,_0xbf79('0x14'));logger[_0xbf79('0x15')](_0xbf79('0x16'),_0x5211fa,_0xbf79('0x14'),JSON[_0xbf79('0x17')](_0x37b698));if(_0x37b698[_0xbf79('0x18')]){if(_0x37b698[_0xbf79('0x18')][_0xbf79('0x19')]===0x1f4){logger[_0xbf79('0x18')]('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);return _0x484dae(_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0x37b698[_0xbf79('0x18')]['message']);return _0x53ca23(_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);}else{logger[_0xbf79('0x12')]('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0xbf79('0x14'));_0x53ca23(_0x37b698[_0xbf79('0x1b')][_0xbf79('0x1a')]);}})['catch'](function(_0x26cb87){logger[_0xbf79('0x18')](_0xbf79('0x13'),_0x5211fa,_0x26cb87);_0x484dae(_0x26cb87);});});}exports[_0xbf79('0x1c')]=function(_0x25305c){var _0x8b6f45=this;return new Promise(function(_0x353f12,_0xf36665){return db[_0xbf79('0x1d')][_0xbf79('0x1e')]({'raw':_0x25305c[_0xbf79('0x1f')]?_0x25305c['options'][_0xbf79('0x20')]===undefined?!![]:![]:!![],'where':_0x25305c[_0xbf79('0x1f')]?_0x25305c[_0xbf79('0x1f')]['where']||null:null,'attributes':_0x25305c['options']?_0x25305c[_0xbf79('0x1f')][_0xbf79('0x21')]||null:null,'limit':_0x25305c['options']?_0x25305c['options'][_0xbf79('0x22')]||null:null,'include':_0x25305c['options']?_0x25305c[_0xbf79('0x1f')][_0xbf79('0x23')]?_[_0xbf79('0x24')](_0x25305c[_0xbf79('0x1f')][_0xbf79('0x23')],function(_0x5f30bd){return{'model':db[_0x5f30bd[_0xbf79('0x25')]],'as':_0x5f30bd['as'],'attributes':_0x5f30bd['attributes'],'include':_0x5f30bd['include']?_[_0xbf79('0x24')](_0x5f30bd['include'],function(_0x1317c0){return{'model':db[_0x1317c0[_0xbf79('0x25')]],'as':_0x1317c0['as'],'attributes':_0x1317c0['attributes'],'include':_0x1317c0[_0xbf79('0x23')]?_['map'](_0x1317c0[_0xbf79('0x23')],function(_0x320f6e){return{'model':db[_0x320f6e[_0xbf79('0x25')]],'as':_0x320f6e['as'],'attributes':_0x320f6e[_0xbf79('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf79('0x11')](function(_0x5dba78){logger['info'](_0xbf79('0x1c'),_0x25305c);logger[_0xbf79('0x15')](_0xbf79('0x1c'),_0x25305c,JSON['stringify'](_0x5dba78));_0x353f12(_0x5dba78);})['catch'](function(_0xf7e3eb){logger[_0xbf79('0x18')](_0xbf79('0x1c'),_0xf7e3eb[_0xbf79('0x1a')],_0x25305c);_0xf36665(_0x8b6f45[_0xbf79('0x18')](0x1f4,_0xf7e3eb[_0xbf79('0x1a')]));});});};exports[_0xbf79('0x26')]=function(_0x400e7e){var _0xa669de=this;return new Promise(function(_0xabd6d3,_0x371e0b){return db[_0xbf79('0x1d')][_0xbf79('0x27')]({'raw':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x20')]===undefined?!![]:![]:!![],'where':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x28')]||null:null,'attributes':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x21')]||null:null,'include':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e['options'][_0xbf79('0x23')]?_[_0xbf79('0x24')](_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x23')],function(_0x2e1e5b){return{'model':db[_0x2e1e5b[_0xbf79('0x25')]],'as':_0x2e1e5b['as'],'attributes':_0x2e1e5b[_0xbf79('0x21')],'include':_0x2e1e5b[_0xbf79('0x23')]?_['map'](_0x2e1e5b[_0xbf79('0x23')],function(_0x24872d){return{'model':db[_0x24872d['model']],'as':_0x24872d['as'],'attributes':_0x24872d['attributes'],'include':_0x24872d['include']?_[_0xbf79('0x24')](_0x24872d[_0xbf79('0x23')],function(_0x507ac2){return{'model':db[_0x507ac2['model']],'as':_0x507ac2['as'],'attributes':_0x507ac2[_0xbf79('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf79('0x11')](function(_0xf025a7){logger[_0xbf79('0x12')](_0xbf79('0x26'),_0x400e7e);logger['debug'](_0xbf79('0x26'),_0x400e7e,JSON[_0xbf79('0x17')](_0xf025a7));_0xabd6d3(_0xf025a7);})['catch'](function(_0x192b49){logger[_0xbf79('0x18')]('ShowChatQueue',_0x192b49[_0xbf79('0x1a')],_0x400e7e);_0x371e0b(_0xa669de[_0xbf79('0x18')](0x1f4,_0x192b49['message']));});});};
\ No newline at end of file
+var _0x04b5=['catch','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','GetChatQueue','stringify','ShowChatQueue','find','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x04b5,0x1ef));var _0x504b=function(_0x3e69b2,_0x25bd25){_0x3e69b2=_0x3e69b2-0x0;var _0x2fe620=_0x04b5[_0x3e69b2];return _0x2fe620;};'use strict';var _=require('lodash');var util=require(_0x504b('0x0'));var moment=require(_0x504b('0x1'));var BPromise=require('bluebird');var rs=require(_0x504b('0x2'));var fs=require('fs');var Redis=require(_0x504b('0x3'));var db=require(_0x504b('0x4'))['db'];var utils=require(_0x504b('0x5'));var logger=require('../../config/logger')(_0x504b('0x6'));var config=require(_0x504b('0x7'));var jayson=require(_0x504b('0x8'));var client=jayson['client'][_0x504b('0x9')]({'port':0x232a});config[_0x504b('0xa')]=_[_0x504b('0xb')](config[_0x504b('0xa')],{'host':_0x504b('0xc'),'port':0x18eb});var socket=require(_0x504b('0xd'))(new Redis(config[_0x504b('0xa')]));require(_0x504b('0xe'))[_0x504b('0xf')](socket);function respondWithRpcPromise(_0x27ca56,_0x54b37b,_0x28b27c){return new BPromise(function(_0x21bcf9,_0x5bc1ae){return client['request'](_0x27ca56,_0x28b27c)[_0x504b('0x10')](function(_0x461880){logger[_0x504b('0x11')](_0x504b('0x12'),_0x54b37b,_0x504b('0x13'));logger[_0x504b('0x14')](_0x504b('0x15'),_0x54b37b,_0x504b('0x13'),JSON['stringify'](_0x461880));if(_0x461880['error']){if(_0x461880[_0x504b('0x16')][_0x504b('0x17')]===0x1f4){logger[_0x504b('0x16')](_0x504b('0x12'),_0x54b37b,_0x461880[_0x504b('0x16')][_0x504b('0x18')]);return _0x5bc1ae(_0x461880['error']['message']);}logger['error'](_0x504b('0x12'),_0x54b37b,_0x461880[_0x504b('0x16')][_0x504b('0x18')]);return _0x21bcf9(_0x461880[_0x504b('0x16')][_0x504b('0x18')]);}else{logger['info'](_0x504b('0x12'),_0x54b37b,'request\x20sent');_0x21bcf9(_0x461880['result']['message']);}})[_0x504b('0x19')](function(_0x7c2bbf){logger[_0x504b('0x16')](_0x504b('0x12'),_0x54b37b,_0x7c2bbf);_0x5bc1ae(_0x7c2bbf);});});}exports['GetChatQueue']=function(_0x258238){var _0x2eae39=this;return new Promise(function(_0x2ce220,_0x28616e){return db[_0x504b('0x1a')][_0x504b('0x1b')]({'raw':_0x258238[_0x504b('0x1c')]?_0x258238['options'][_0x504b('0x1d')]===undefined?!![]:![]:!![],'where':_0x258238[_0x504b('0x1c')]?_0x258238[_0x504b('0x1c')]['where']||null:null,'attributes':_0x258238['options']?_0x258238[_0x504b('0x1c')][_0x504b('0x1e')]||null:null,'limit':_0x258238[_0x504b('0x1c')]?_0x258238[_0x504b('0x1c')][_0x504b('0x1f')]||null:null,'include':_0x258238[_0x504b('0x1c')]?_0x258238['options'][_0x504b('0x20')]?_[_0x504b('0x21')](_0x258238[_0x504b('0x1c')][_0x504b('0x20')],function(_0x3ec855){return{'model':db[_0x3ec855[_0x504b('0x22')]],'as':_0x3ec855['as'],'attributes':_0x3ec855[_0x504b('0x1e')],'include':_0x3ec855[_0x504b('0x20')]?_['map'](_0x3ec855[_0x504b('0x20')],function(_0x5832f1){return{'model':db[_0x5832f1['model']],'as':_0x5832f1['as'],'attributes':_0x5832f1[_0x504b('0x1e')],'include':_0x5832f1[_0x504b('0x20')]?_[_0x504b('0x21')](_0x5832f1[_0x504b('0x20')],function(_0x3495be){return{'model':db[_0x3495be[_0x504b('0x22')]],'as':_0x3495be['as'],'attributes':_0x3495be[_0x504b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x593f27){logger[_0x504b('0x11')](_0x504b('0x23'),_0x258238);logger[_0x504b('0x14')](_0x504b('0x23'),_0x258238,JSON[_0x504b('0x24')](_0x593f27));_0x2ce220(_0x593f27);})[_0x504b('0x19')](function(_0x5de9b0){logger[_0x504b('0x16')](_0x504b('0x23'),_0x5de9b0[_0x504b('0x18')],_0x258238);_0x28616e(_0x2eae39[_0x504b('0x16')](0x1f4,_0x5de9b0['message']));});});};exports[_0x504b('0x25')]=function(_0x535a8d){var _0x31131c=this;return new Promise(function(_0x1923c6,_0x56a734){return db['ChatQueue'][_0x504b('0x26')]({'raw':_0x535a8d[_0x504b('0x1c')]?_0x535a8d['options']['raw']===undefined?!![]:![]:!![],'where':_0x535a8d['options']?_0x535a8d[_0x504b('0x1c')][_0x504b('0x27')]||null:null,'attributes':_0x535a8d[_0x504b('0x1c')]?_0x535a8d[_0x504b('0x1c')][_0x504b('0x1e')]||null:null,'include':_0x535a8d[_0x504b('0x1c')]?_0x535a8d[_0x504b('0x1c')][_0x504b('0x20')]?_[_0x504b('0x21')](_0x535a8d[_0x504b('0x1c')][_0x504b('0x20')],function(_0x49cd05){return{'model':db[_0x49cd05[_0x504b('0x22')]],'as':_0x49cd05['as'],'attributes':_0x49cd05[_0x504b('0x1e')],'include':_0x49cd05[_0x504b('0x20')]?_[_0x504b('0x21')](_0x49cd05['include'],function(_0xbd6bbc){return{'model':db[_0xbd6bbc[_0x504b('0x22')]],'as':_0xbd6bbc['as'],'attributes':_0xbd6bbc[_0x504b('0x1e')],'include':_0xbd6bbc[_0x504b('0x20')]?_[_0x504b('0x21')](_0xbd6bbc[_0x504b('0x20')],function(_0x5ad646){return{'model':db[_0x5ad646[_0x504b('0x22')]],'as':_0x5ad646['as'],'attributes':_0x5ad646['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2269c2){logger['info'](_0x504b('0x25'),_0x535a8d);logger[_0x504b('0x14')](_0x504b('0x25'),_0x535a8d,JSON[_0x504b('0x24')](_0x2269c2));_0x1923c6(_0x2269c2);})[_0x504b('0x19')](function(_0x3954a0){logger[_0x504b('0x16')](_0x504b('0x25'),_0x3954a0[_0x504b('0x18')],_0x535a8d);_0x56a734(_0x31131c['error'](0x1f4,_0x3954a0[_0x504b('0x18')]));});});};
\ No newline at end of file