Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / chatMessage / chatMessage.rpc.js
index 8d6657a..adf04d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d2=['body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','CreateChatMessage','ChatMessage','create'];(function(_0x47d506,_0x5a1e99){var _0x58251a=function(_0x476cef){while(--_0x476cef){_0x47d506['push'](_0x47d506['shift']());}};_0x58251a(++_0x5a1e99);}(_0x98d2,0x1c4));var _0x298d=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x98d2[_0x3bceea];return _0x30a8d3;};'use strict';var _=require(_0x298d('0x0'));var util=require(_0x298d('0x1'));var moment=require(_0x298d('0x2'));var BPromise=require('bluebird');var rs=require(_0x298d('0x3'));var fs=require('fs');var Redis=require(_0x298d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x298d('0x5'));var logger=require(_0x298d('0x6'))(_0x298d('0x7'));var config=require(_0x298d('0x8'));var jayson=require(_0x298d('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x298d('0xa')](config['redis'],{'host':_0x298d('0xb'),'port':0x18eb});var socket=require(_0x298d('0xc'))(new Redis(config['redis']));require(_0x298d('0xd'))[_0x298d('0xe')](socket);function respondWithRpcPromise(_0x1685f2,_0x2190f1,_0x1f8323){return new BPromise(function(_0x5e74db,_0x1abde7){return client[_0x298d('0xf')](_0x1685f2,_0x1f8323)[_0x298d('0x10')](function(_0x30965d){logger[_0x298d('0x11')](_0x298d('0x12'),_0x2190f1,'request\x20sent');logger[_0x298d('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2190f1,_0x298d('0x14'),JSON[_0x298d('0x15')](_0x30965d));if(_0x30965d[_0x298d('0x16')]){if(_0x30965d['error'][_0x298d('0x17')]===0x1f4){logger[_0x298d('0x16')](_0x298d('0x12'),_0x2190f1,_0x30965d[_0x298d('0x16')][_0x298d('0x18')]);return _0x1abde7(_0x30965d[_0x298d('0x16')][_0x298d('0x18')]);}logger[_0x298d('0x16')](_0x298d('0x12'),_0x2190f1,_0x30965d[_0x298d('0x16')][_0x298d('0x18')]);return _0x5e74db(_0x30965d[_0x298d('0x16')][_0x298d('0x18')]);}else{logger[_0x298d('0x11')](_0x298d('0x12'),_0x2190f1,_0x298d('0x14'));_0x5e74db(_0x30965d['result'][_0x298d('0x18')]);}})['catch'](function(_0x48aba2){logger[_0x298d('0x16')](_0x298d('0x12'),_0x2190f1,_0x48aba2);_0x1abde7(_0x48aba2);});});}exports[_0x298d('0x19')]=function(_0x29f188){var _0x4dd663=this;return new Promise(function(_0x3a9b0c,_0x1c473c){return db[_0x298d('0x1a')][_0x298d('0x1b')](_0x29f188[_0x298d('0x1c')],{'raw':_0x29f188['options']?_0x29f188[_0x298d('0x1d')][_0x298d('0x1e')]===undefined?!![]:![]:!![]})[_0x298d('0x10')](function(_0x2666a4){logger['info'](_0x298d('0x19'),_0x29f188);logger['debug'](_0x298d('0x19'),_0x29f188,JSON['stringify'](_0x2666a4));_0x3a9b0c(_0x2666a4);})[_0x298d('0x1f')](function(_0x2bb89f){logger[_0x298d('0x16')](_0x298d('0x19'),_0x2bb89f['message'],_0x29f188);_0x1c473c(_0x4dd663[_0x298d('0x16')](0x1f4,_0x2bb89f[_0x298d('0x18')]));});});};
\ No newline at end of file
+var _0xcd3a=['raw','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','create','body','options'];(function(_0x526aeb,_0x33c315){var _0xe874c4=function(_0x1dd7e1){while(--_0x1dd7e1){_0x526aeb['push'](_0x526aeb['shift']());}};_0xe874c4(++_0x33c315);}(_0xcd3a,0x8e));var _0xacd3=function(_0x1daba6,_0x2dfd65){_0x1daba6=_0x1daba6-0x0;var _0x2f8a91=_0xcd3a[_0x1daba6];return _0x2f8a91;};'use strict';var _=require('lodash');var util=require(_0xacd3('0x0'));var moment=require(_0xacd3('0x1'));var BPromise=require(_0xacd3('0x2'));var rs=require(_0xacd3('0x3'));var fs=require('fs');var Redis=require(_0xacd3('0x4'));var db=require(_0xacd3('0x5'))['db'];var utils=require(_0xacd3('0x6'));var logger=require(_0xacd3('0x7'))(_0xacd3('0x8'));var config=require('../../config/environment');var jayson=require(_0xacd3('0x9'));var client=jayson[_0xacd3('0xa')][_0xacd3('0xb')]({'port':0x232a});config[_0xacd3('0xc')]=_[_0xacd3('0xd')](config['redis'],{'host':_0xacd3('0xe'),'port':0x18eb});var socket=require(_0xacd3('0xf'))(new Redis(config[_0xacd3('0xc')]));require(_0xacd3('0x10'))['register'](socket);function respondWithRpcPromise(_0x14ac53,_0x51bcae,_0x3c6b24){return new BPromise(function(_0x3512e8,_0x2bf95b){return client[_0xacd3('0x11')](_0x14ac53,_0x3c6b24)[_0xacd3('0x12')](function(_0x13254c){logger[_0xacd3('0x13')](_0xacd3('0x14'),_0x51bcae,_0xacd3('0x15'));logger[_0xacd3('0x16')](_0xacd3('0x17'),_0x51bcae,'request\x20sent',JSON[_0xacd3('0x18')](_0x13254c));if(_0x13254c[_0xacd3('0x19')]){if(_0x13254c[_0xacd3('0x19')][_0xacd3('0x1a')]===0x1f4){logger[_0xacd3('0x19')](_0xacd3('0x14'),_0x51bcae,_0x13254c[_0xacd3('0x19')][_0xacd3('0x1b')]);return _0x2bf95b(_0x13254c[_0xacd3('0x19')]['message']);}logger[_0xacd3('0x19')](_0xacd3('0x14'),_0x51bcae,_0x13254c[_0xacd3('0x19')]['message']);return _0x3512e8(_0x13254c[_0xacd3('0x19')][_0xacd3('0x1b')]);}else{logger[_0xacd3('0x13')](_0xacd3('0x14'),_0x51bcae,_0xacd3('0x15'));_0x3512e8(_0x13254c[_0xacd3('0x1c')][_0xacd3('0x1b')]);}})['catch'](function(_0x103dcb){logger[_0xacd3('0x19')](_0xacd3('0x14'),_0x51bcae,_0x103dcb);_0x2bf95b(_0x103dcb);});});}exports[_0xacd3('0x1d')]=function(_0x295b47){var _0x1ebedb=this;return new Promise(function(_0x4a0b08,_0x10ca0f){return db['ChatMessage'][_0xacd3('0x1e')](_0x295b47[_0xacd3('0x1f')],{'raw':_0x295b47[_0xacd3('0x20')]?_0x295b47['options'][_0xacd3('0x21')]===undefined?!![]:![]:!![]})[_0xacd3('0x12')](function(_0x3f1029){logger[_0xacd3('0x13')](_0xacd3('0x1d'),_0x295b47);logger[_0xacd3('0x16')](_0xacd3('0x1d'),_0x295b47,JSON[_0xacd3('0x18')](_0x3f1029));_0x4a0b08(_0x3f1029);})[_0xacd3('0x22')](function(_0x34de83){logger[_0xacd3('0x19')](_0xacd3('0x1d'),_0x34de83['message'],_0x295b47);_0x10ca0f(_0x1ebedb[_0xacd3('0x19')](0x1f4,_0x34de83[_0xacd3('0x1b')]));});});};
\ No newline at end of file