Built motion from commit ab870f9e.|2.5.44
[motion2.git] / server / api / chatMessage / chatMessage.rpc.js
index a4705b3..3160a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc22f=['localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x2bdba7,_0x24f2c3){var _0x283dfe=function(_0x1065dc){while(--_0x1065dc){_0x2bdba7['push'](_0x2bdba7['shift']());}};_0x283dfe(++_0x24f2c3);}(_0xc22f,0xbf));var _0xfc22=function(_0x422957,_0x6df95c){_0x422957=_0x422957-0x0;var _0x2b8cc5=_0xc22f[_0x422957];return _0x2b8cc5;};'use strict';var _=require(_0xfc22('0x0'));var util=require(_0xfc22('0x1'));var moment=require(_0xfc22('0x2'));var BPromise=require(_0xfc22('0x3'));var rs=require(_0xfc22('0x4'));var fs=require('fs');var Redis=require(_0xfc22('0x5'));var db=require(_0xfc22('0x6'))['db'];var utils=require(_0xfc22('0x7'));var logger=require(_0xfc22('0x8'))(_0xfc22('0x9'));var config=require(_0xfc22('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc22('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfc22('0xc')],{'host':_0xfc22('0xd'),'port':0x18eb});var socket=require(_0xfc22('0xe'))(new Redis(config[_0xfc22('0xc')]));require(_0xfc22('0xf'))[_0xfc22('0x10')](socket);function respondWithRpcPromise(_0x17fd71,_0x20d356,_0x535d1d){return new BPromise(function(_0x322e50,_0x3445e5){return client[_0xfc22('0x11')](_0x17fd71,_0x535d1d)['then'](function(_0x5d48e7){logger['info'](_0xfc22('0x12'),_0x20d356,_0xfc22('0x13'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x20d356,_0xfc22('0x13'),JSON[_0xfc22('0x14')](_0x5d48e7));if(_0x5d48e7['error']){if(_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x16')]===0x1f4){logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x3445e5(_0x5d48e7['error'][_0xfc22('0x17')]);}logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);return _0x322e50(_0x5d48e7[_0xfc22('0x15')][_0xfc22('0x17')]);}else{logger[_0xfc22('0x18')](_0xfc22('0x12'),_0x20d356,_0xfc22('0x13'));_0x322e50(_0x5d48e7[_0xfc22('0x19')][_0xfc22('0x17')]);}})[_0xfc22('0x1a')](function(_0x92770d){logger[_0xfc22('0x15')](_0xfc22('0x12'),_0x20d356,_0x92770d);_0x3445e5(_0x92770d);});});}exports[_0xfc22('0x1b')]=function(_0x5d9c16){var _0x464bbd=this;return new Promise(function(_0x582b9c,_0x1ffeaf){return db[_0xfc22('0x1c')][_0xfc22('0x1d')](_0x5d9c16[_0xfc22('0x1e')],{'raw':_0x5d9c16[_0xfc22('0x1f')]?_0x5d9c16[_0xfc22('0x1f')][_0xfc22('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ed300){logger[_0xfc22('0x18')](_0xfc22('0x1b'),_0x5d9c16);logger[_0xfc22('0x21')](_0xfc22('0x1b'),_0x5d9c16,JSON[_0xfc22('0x14')](_0x1ed300));_0x582b9c(_0x1ed300);})[_0xfc22('0x1a')](function(_0x4d04ac){logger[_0xfc22('0x15')](_0xfc22('0x1b'),_0x4d04ac[_0xfc22('0x17')],_0x5d9c16);_0x1ffeaf(_0x464bbd[_0xfc22('0x15')](0x1f4,_0x4d04ac[_0xfc22('0x17')]));});});};
\ No newline at end of file
+var _0x22b4=['message','result','CreateChatMessage','ChatMessage','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x17b38a,_0x46b1b4){var _0x20179b=function(_0x36e717){while(--_0x36e717){_0x17b38a['push'](_0x17b38a['shift']());}};_0x20179b(++_0x46b1b4);}(_0x22b4,0x8b));var _0x422b=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x22b4[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x422b('0x0'));var util=require(_0x422b('0x1'));var moment=require(_0x422b('0x2'));var BPromise=require(_0x422b('0x3'));var rs=require(_0x422b('0x4'));var fs=require('fs');var Redis=require(_0x422b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x422b('0x6'));var logger=require(_0x422b('0x7'))('rpc');var config=require(_0x422b('0x8'));var jayson=require(_0x422b('0x9'));var client=jayson[_0x422b('0xa')][_0x422b('0xb')]({'port':0x232a});config[_0x422b('0xc')]=_[_0x422b('0xd')](config['redis'],{'host':_0x422b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x422b('0xc')]));require(_0x422b('0xf'))[_0x422b('0x10')](socket);function respondWithRpcPromise(_0x13e837,_0x2223a5,_0x42bcfa){return new BPromise(function(_0x552298,_0x3bfc9a){return client[_0x422b('0x11')](_0x13e837,_0x42bcfa)[_0x422b('0x12')](function(_0x419b65){logger[_0x422b('0x13')](_0x422b('0x14'),_0x2223a5,_0x422b('0x15'));logger[_0x422b('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2223a5,'request\x20sent',JSON[_0x422b('0x17')](_0x419b65));if(_0x419b65[_0x422b('0x18')]){if(_0x419b65[_0x422b('0x18')][_0x422b('0x19')]===0x1f4){logger[_0x422b('0x18')](_0x422b('0x14'),_0x2223a5,_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);return _0x3bfc9a(_0x419b65['error'][_0x422b('0x1a')]);}logger['error'](_0x422b('0x14'),_0x2223a5,_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);return _0x552298(_0x419b65[_0x422b('0x18')][_0x422b('0x1a')]);}else{logger[_0x422b('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2223a5,_0x422b('0x15'));_0x552298(_0x419b65[_0x422b('0x1b')][_0x422b('0x1a')]);}})['catch'](function(_0x131330){logger[_0x422b('0x18')](_0x422b('0x14'),_0x2223a5,_0x131330);_0x3bfc9a(_0x131330);});});}exports[_0x422b('0x1c')]=function(_0x16073e){var _0x46d6bb=this;return new Promise(function(_0x25bd15,_0x51049c){return db[_0x422b('0x1d')]['create'](_0x16073e['body'],{'raw':_0x16073e[_0x422b('0x1e')]?_0x16073e['options'][_0x422b('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3f7619){logger[_0x422b('0x13')](_0x422b('0x1c'),_0x16073e);logger['debug'](_0x422b('0x1c'),_0x16073e,JSON[_0x422b('0x17')](_0x3f7619));_0x25bd15(_0x3f7619);})[_0x422b('0x20')](function(_0x3cc51c){logger[_0x422b('0x18')](_0x422b('0x1c'),_0x3cc51c[_0x422b('0x1a')],_0x16073e);_0x51049c(_0x46d6bb[_0x422b('0x18')](0x1f4,_0x3cc51c[_0x422b('0x1a')]));});});};
\ No newline at end of file