Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / chatMessage / chatMessage.rpc.js
index 8d594c5..adf04d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ac4=['ChatMessage','create','body','options','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','socket.io-emitter','redis','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1ac4,0xa5));var _0x41ac=function(_0x1999f8,_0x533cd9){_0x1999f8=_0x1999f8-0x0;var _0x565134=_0x1ac4[_0x1999f8];return _0x565134;};'use strict';var _=require(_0x41ac('0x0'));var util=require(_0x41ac('0x1'));var moment=require(_0x41ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x41ac('0x3'));var fs=require('fs');var Redis=require(_0x41ac('0x4'));var db=require(_0x41ac('0x5'))['db'];var utils=require(_0x41ac('0x6'));var logger=require(_0x41ac('0x7'))(_0x41ac('0x8'));var config=require(_0x41ac('0x9'));var jayson=require(_0x41ac('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x41ac('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41ac('0xc'))(new Redis(config[_0x41ac('0xd')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x53a556,_0x2321b9,_0x4bb727){return new BPromise(function(_0x2eb14f,_0x124d77){return client[_0x41ac('0xe')](_0x53a556,_0x4bb727)[_0x41ac('0xf')](function(_0x55f614){logger['info'](_0x41ac('0x10'),_0x2321b9,_0x41ac('0x11'));logger[_0x41ac('0x12')](_0x41ac('0x13'),_0x2321b9,'request\x20sent',JSON['stringify'](_0x55f614));if(_0x55f614[_0x41ac('0x14')]){if(_0x55f614[_0x41ac('0x14')][_0x41ac('0x15')]===0x1f4){logger['error'](_0x41ac('0x10'),_0x2321b9,_0x55f614[_0x41ac('0x14')][_0x41ac('0x16')]);return _0x124d77(_0x55f614['error'][_0x41ac('0x16')]);}logger[_0x41ac('0x14')](_0x41ac('0x10'),_0x2321b9,_0x55f614[_0x41ac('0x14')][_0x41ac('0x16')]);return _0x2eb14f(_0x55f614[_0x41ac('0x14')][_0x41ac('0x16')]);}else{logger[_0x41ac('0x17')]('ChatMessage,\x20%s,\x20%s',_0x2321b9,'request\x20sent');_0x2eb14f(_0x55f614[_0x41ac('0x18')][_0x41ac('0x16')]);}})[_0x41ac('0x19')](function(_0xff8a13){logger[_0x41ac('0x14')](_0x41ac('0x10'),_0x2321b9,_0xff8a13);_0x124d77(_0xff8a13);});});}exports[_0x41ac('0x1a')]=function(_0xf26d58){var _0x3a4036=this;return new Promise(function(_0x10ad98,_0x6eee23){return db[_0x41ac('0x1b')][_0x41ac('0x1c')](_0xf26d58[_0x41ac('0x1d')],{'raw':_0xf26d58['options']?_0xf26d58[_0x41ac('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x41ac('0xf')](function(_0x57b174){logger[_0x41ac('0x17')](_0x41ac('0x1a'),_0xf26d58);logger[_0x41ac('0x12')](_0x41ac('0x1a'),_0xf26d58,JSON[_0x41ac('0x1f')](_0x57b174));_0x10ad98(_0x57b174);})[_0x41ac('0x19')](function(_0x57593c){logger['error']('CreateChatMessage',_0x57593c['message'],_0xf26d58);_0x6eee23(_0x3a4036['error'](0x1f4,_0x57593c[_0x41ac('0x16')]));});});};
\ 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