Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index be31261..ace5a76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0223=['then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0x3b00dc,_0x5d08d2){var _0x9fde1d=function(_0x43aac0){while(--_0x43aac0){_0x3b00dc['push'](_0x3b00dc['shift']());}};_0x9fde1d(++_0x5d08d2);}(_0x0223,0xcb));var _0x3022=function(_0x1c238f,_0x36012b){_0x1c238f=_0x1c238f-0x0;var _0x344288=_0x0223[_0x1c238f];return _0x344288;};'use strict';var _=require(_0x3022('0x0'));var util=require(_0x3022('0x1'));var moment=require(_0x3022('0x2'));var BPromise=require(_0x3022('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3022('0x4'))['db'];var utils=require(_0x3022('0x5'));var logger=require(_0x3022('0x6'))('rpc');var config=require(_0x3022('0x7'));var jayson=require(_0x3022('0x8'));var client=jayson['client'][_0x3022('0x9')]({'port':0x232a});config[_0x3022('0xa')]=_[_0x3022('0xb')](config[_0x3022('0xa')],{'host':_0x3022('0xc'),'port':0x18eb});var socket=require(_0x3022('0xd'))(new Redis(config['redis']));require(_0x3022('0xe'))[_0x3022('0xf')](socket);function respondWithRpcPromise(_0x489bbc,_0x2eb0a8,_0x6f09ef){return new BPromise(function(_0x5dbbfa,_0x533953){return client[_0x3022('0x10')](_0x489bbc,_0x6f09ef)[_0x3022('0x11')](function(_0x31d43f){logger[_0x3022('0x12')](_0x3022('0x13'),_0x2eb0a8,_0x3022('0x14'));logger[_0x3022('0x15')](_0x3022('0x16'),_0x2eb0a8,'request\x20sent',JSON[_0x3022('0x17')](_0x31d43f));if(_0x31d43f[_0x3022('0x18')]){if(_0x31d43f[_0x3022('0x18')][_0x3022('0x19')]===0x1f4){logger['error'](_0x3022('0x13'),_0x2eb0a8,_0x31d43f[_0x3022('0x18')][_0x3022('0x1a')]);return _0x533953(_0x31d43f[_0x3022('0x18')][_0x3022('0x1a')]);}logger[_0x3022('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x2eb0a8,_0x31d43f[_0x3022('0x18')][_0x3022('0x1a')]);return _0x5dbbfa(_0x31d43f[_0x3022('0x18')][_0x3022('0x1a')]);}else{logger['info'](_0x3022('0x13'),_0x2eb0a8,_0x3022('0x14'));_0x5dbbfa(_0x31d43f[_0x3022('0x1b')]['message']);}})[_0x3022('0x1c')](function(_0x2d04af){logger[_0x3022('0x18')](_0x3022('0x13'),_0x2eb0a8,_0x2d04af);_0x533953(_0x2d04af);});});}exports['UpdateChatInteraction']=function(_0x5a12fd){var _0x3dffaa=this;return new Promise(function(_0x182eb2,_0x33a59b){return db[_0x3022('0x1d')][_0x3022('0x1e')](_0x5a12fd[_0x3022('0x1f')],{'raw':_0x5a12fd[_0x3022('0x20')]?_0x5a12fd[_0x3022('0x20')][_0x3022('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a12fd[_0x3022('0x20')]?_0x5a12fd[_0x3022('0x20')][_0x3022('0x22')]||null:null,'attributes':_0x5a12fd[_0x3022('0x20')]?_0x5a12fd[_0x3022('0x20')][_0x3022('0x23')]||null:null,'limit':_0x5a12fd[_0x3022('0x20')]?_0x5a12fd[_0x3022('0x20')][_0x3022('0x24')]||null:null})[_0x3022('0x11')](function(_0x47ce63){logger[_0x3022('0x12')](_0x3022('0x25'),_0x5a12fd);logger[_0x3022('0x15')](_0x3022('0x25'),_0x5a12fd,JSON['stringify'](_0x47ce63));_0x182eb2(_0x47ce63);})[_0x3022('0x1c')](function(_0x23cce6){logger[_0x3022('0x18')](_0x3022('0x25'),_0x23cce6[_0x3022('0x1a')],_0x5a12fd);_0x33a59b(_0x3dffaa['error'](0x1f4,_0x23cce6[_0x3022('0x1a')]));});});};exports[_0x3022('0x26')]=function(_0x5eb071){return new Promise(function(_0x3e6dd5,_0x514ecf){return db[_0x3022('0x1d')]['find']({'where':_0x5eb071[_0x3022('0x20')]?_0x5eb071[_0x3022('0x20')][_0x3022('0x22')]||null:null})[_0x3022('0x11')](function(_0x9ecf1b){if(_0x9ecf1b){return _0x9ecf1b[_0x3022('0x27')](_0x5eb071['body'][_0x3022('0x28')],_[_0x3022('0x29')](_0x5eb071[_0x3022('0x1f')],[_0x3022('0x28'),'id'])||{});}})[_0x3022('0x2a')](function(_0x37b398){logger[_0x3022('0x12')]('AddTags',_0x5eb071);logger['debug']('AddTags',_0x5eb071,JSON['stringify'](_0x37b398));_0x3e6dd5(_0x37b398);})[_0x3022('0x1c')](function(_0x2c0afb){logger[_0x3022('0x18')](_0x3022('0x2b'),_0x2c0afb['message'],_0x5eb071);_0x514ecf(_this[_0x3022('0x18')](0x1f4,_0x2c0afb[_0x3022('0x1a')]));});});};
\ No newline at end of file
+var _0x7001=['ChatInteraction','find','where','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','update','body','options','raw','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction'];(function(_0x4c3267,_0xf2b77){var _0xfa5c9=function(_0x445e6d){while(--_0x445e6d){_0x4c3267['push'](_0x4c3267['shift']());}};_0xfa5c9(++_0xf2b77);}(_0x7001,0x180));var _0x1700=function(_0x4bd9f8,_0x5b2516){_0x4bd9f8=_0x4bd9f8-0x0;var _0x4b35f9=_0x7001[_0x4bd9f8];return _0x4b35f9;};'use strict';var _=require(_0x1700('0x0'));var util=require(_0x1700('0x1'));var moment=require(_0x1700('0x2'));var BPromise=require(_0x1700('0x3'));var rs=require(_0x1700('0x4'));var fs=require('fs');var Redis=require(_0x1700('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1700('0x6'));var logger=require(_0x1700('0x7'))(_0x1700('0x8'));var config=require(_0x1700('0x9'));var jayson=require(_0x1700('0xa'));var client=jayson[_0x1700('0xb')]['http']({'port':0x232a});config[_0x1700('0xc')]=_[_0x1700('0xd')](config[_0x1700('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1700('0xc')]));require(_0x1700('0xe'))[_0x1700('0xf')](socket);function respondWithRpcPromise(_0x3a3b6c,_0x41e28e,_0x34a811){return new BPromise(function(_0x25ca3c,_0x5aa325){return client[_0x1700('0x10')](_0x3a3b6c,_0x34a811)[_0x1700('0x11')](function(_0x532e31){logger[_0x1700('0x12')](_0x1700('0x13'),_0x41e28e,'request\x20sent');logger[_0x1700('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x41e28e,'request\x20sent',JSON['stringify'](_0x532e31));if(_0x532e31[_0x1700('0x15')]){if(_0x532e31[_0x1700('0x15')][_0x1700('0x16')]===0x1f4){logger[_0x1700('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x41e28e,_0x532e31[_0x1700('0x15')][_0x1700('0x17')]);return _0x5aa325(_0x532e31[_0x1700('0x15')][_0x1700('0x17')]);}logger[_0x1700('0x15')](_0x1700('0x13'),_0x41e28e,_0x532e31[_0x1700('0x15')][_0x1700('0x17')]);return _0x25ca3c(_0x532e31[_0x1700('0x15')]['message']);}else{logger[_0x1700('0x12')](_0x1700('0x13'),_0x41e28e,_0x1700('0x18'));_0x25ca3c(_0x532e31[_0x1700('0x19')][_0x1700('0x17')]);}})[_0x1700('0x1a')](function(_0x54ecbe){logger[_0x1700('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x41e28e,_0x54ecbe);_0x5aa325(_0x54ecbe);});});}exports['UpdateChatInteraction']=function(_0x4a5718){var _0x9053c5=this;return new Promise(function(_0x55f74b,_0x1c58dc){return db['ChatInteraction'][_0x1700('0x1b')](_0x4a5718[_0x1700('0x1c')],{'raw':_0x4a5718['options']?_0x4a5718[_0x1700('0x1d')][_0x1700('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a5718['options']?_0x4a5718[_0x1700('0x1d')]['where']||null:null,'attributes':_0x4a5718[_0x1700('0x1d')]?_0x4a5718[_0x1700('0x1d')][_0x1700('0x1f')]||null:null,'limit':_0x4a5718[_0x1700('0x1d')]?_0x4a5718[_0x1700('0x1d')][_0x1700('0x20')]||null:null})['then'](function(_0x803833){logger[_0x1700('0x12')](_0x1700('0x21'),_0x4a5718);logger[_0x1700('0x14')](_0x1700('0x21'),_0x4a5718,JSON[_0x1700('0x22')](_0x803833));_0x55f74b(_0x803833);})[_0x1700('0x1a')](function(_0x43e330){logger[_0x1700('0x15')](_0x1700('0x21'),_0x43e330[_0x1700('0x17')],_0x4a5718);_0x1c58dc(_0x9053c5[_0x1700('0x15')](0x1f4,_0x43e330[_0x1700('0x17')]));});});};exports[_0x1700('0x23')]=function(_0xfbdabb){return new Promise(function(_0x5ce26c,_0x54b79a){return db[_0x1700('0x24')][_0x1700('0x25')]({'where':_0xfbdabb[_0x1700('0x1d')]?_0xfbdabb[_0x1700('0x1d')][_0x1700('0x26')]||null:null})[_0x1700('0x11')](function(_0x4e15a0){if(_0x4e15a0){return _0x4e15a0['addTags'](_0xfbdabb[_0x1700('0x1c')][_0x1700('0x27')],_['omit'](_0xfbdabb[_0x1700('0x1c')],['ids','id'])||{});}})[_0x1700('0x28')](function(_0x1f9e43){logger[_0x1700('0x12')](_0x1700('0x29'),_0xfbdabb);logger[_0x1700('0x14')](_0x1700('0x29'),_0xfbdabb,JSON[_0x1700('0x22')](_0x1f9e43));_0x5ce26c(_0x1f9e43);})[_0x1700('0x1a')](function(_0x40ea80){logger[_0x1700('0x15')]('AddTags',_0x40ea80[_0x1700('0x17')],_0xfbdabb);_0x54b79a(_this[_0x1700('0x15')](0x1f4,_0x40ea80[_0x1700('0x17')]));});});};
\ No newline at end of file