Built motion from commit ecb45b58.|2.6.31
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index 4e1b18e..d725782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4546=['options','raw','where','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','UpdateChatInteraction','update','body'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0x4546,0xab));var _0x6454=function(_0x50b6cc,_0x4dfee5){_0x50b6cc=_0x50b6cc-0x0;var _0x93119c=_0x4546[_0x50b6cc];return _0x93119c;};'use strict';var _=require(_0x6454('0x0'));var util=require(_0x6454('0x1'));var moment=require(_0x6454('0x2'));var BPromise=require(_0x6454('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6454('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6454('0x5'))(_0x6454('0x6'));var config=require(_0x6454('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6454('0x8')]['http']({'port':0x232a});config[_0x6454('0x9')]=_[_0x6454('0xa')](config[_0x6454('0x9')],{'host':_0x6454('0xb'),'port':0x18eb});var socket=require(_0x6454('0xc'))(new Redis(config[_0x6454('0x9')]));require(_0x6454('0xd'))[_0x6454('0xe')](socket);function respondWithRpcPromise(_0x4d8e6d,_0x48278f,_0x3630cb){return new BPromise(function(_0x13ef93,_0x566d2f){return client[_0x6454('0xf')](_0x4d8e6d,_0x3630cb)[_0x6454('0x10')](function(_0x1e7230){logger[_0x6454('0x11')](_0x6454('0x12'),_0x48278f,'request\x20sent');logger['debug'](_0x6454('0x13'),_0x48278f,'request\x20sent',JSON[_0x6454('0x14')](_0x1e7230));if(_0x1e7230['error']){if(_0x1e7230['error'][_0x6454('0x15')]===0x1f4){logger[_0x6454('0x16')](_0x6454('0x12'),_0x48278f,_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);return _0x566d2f(_0x1e7230[_0x6454('0x16')]['message']);}logger[_0x6454('0x16')](_0x6454('0x12'),_0x48278f,_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);return _0x13ef93(_0x1e7230[_0x6454('0x16')][_0x6454('0x17')]);}else{logger['info'](_0x6454('0x12'),_0x48278f,_0x6454('0x18'));_0x13ef93(_0x1e7230['result'][_0x6454('0x17')]);}})[_0x6454('0x19')](function(_0x48972b){logger[_0x6454('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x48278f,_0x48972b);_0x566d2f(_0x48972b);});});}exports[_0x6454('0x1a')]=function(_0x587636){var _0x3bc737=this;return new Promise(function(_0x5b1574,_0x29b7ee){return db['ChatInteraction'][_0x6454('0x1b')](_0x587636[_0x6454('0x1c')],{'raw':_0x587636['options']?_0x587636[_0x6454('0x1d')][_0x6454('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x587636['options']?_0x587636[_0x6454('0x1d')][_0x6454('0x1f')]||null:null,'attributes':_0x587636[_0x6454('0x1d')]?_0x587636[_0x6454('0x1d')]['attributes']||null:null,'limit':_0x587636[_0x6454('0x1d')]?_0x587636[_0x6454('0x1d')]['limit']||null:null})[_0x6454('0x10')](function(_0xeda3aa){logger[_0x6454('0x11')]('UpdateChatInteraction',_0x587636);logger[_0x6454('0x20')](_0x6454('0x1a'),_0x587636,JSON['stringify'](_0xeda3aa));_0x5b1574(_0xeda3aa);})['catch'](function(_0x36fc74){logger[_0x6454('0x16')](_0x6454('0x1a'),_0x36fc74['message'],_0x587636);_0x29b7ee(_0x3bc737[_0x6454('0x16')](0x1f4,_0x36fc74[_0x6454('0x17')]));});});};exports[_0x6454('0x21')]=function(_0x26518f){return new Promise(function(_0x30341a,_0x62047a){return db['ChatInteraction'][_0x6454('0x22')]({'where':_0x26518f[_0x6454('0x1d')]?_0x26518f[_0x6454('0x1d')][_0x6454('0x1f')]||null:null})['then'](function(_0x57b197){if(_0x57b197){return _0x57b197[_0x6454('0x23')](_0x26518f[_0x6454('0x1c')][_0x6454('0x24')],_[_0x6454('0x25')](_0x26518f[_0x6454('0x1c')],[_0x6454('0x24'),'id'])||{});}})[_0x6454('0x26')](function(_0x3764e0){logger[_0x6454('0x11')](_0x6454('0x27'),_0x26518f);logger['debug'](_0x6454('0x27'),_0x26518f,JSON['stringify'](_0x3764e0));_0x30341a(_0x3764e0);})[_0x6454('0x19')](function(_0x3be06c){logger['error'](_0x6454('0x27'),_0x3be06c[_0x6454('0x17')],_0x26518f);_0x62047a(_this[_0x6454('0x16')](0x1f4,_0x3be06c[_0x6454('0x17')]));});});};
\ No newline at end of file
+var _0x1334=['UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3fa1e1,_0x4e39f0){var _0x1cc2ad=function(_0x3f6d4d){while(--_0x3f6d4d){_0x3fa1e1['push'](_0x3fa1e1['shift']());}};_0x1cc2ad(++_0x4e39f0);}(_0x1334,0x69));var _0x4133=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x1334[_0x22b68a];return _0x1ac67a;};'use strict';var _=require(_0x4133('0x0'));var util=require(_0x4133('0x1'));var moment=require(_0x4133('0x2'));var BPromise=require(_0x4133('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4133('0x4'));var db=require(_0x4133('0x5'))['db'];var utils=require(_0x4133('0x6'));var logger=require(_0x4133('0x7'))(_0x4133('0x8'));var config=require(_0x4133('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4133('0xa')][_0x4133('0xb')]({'port':0x232a});config[_0x4133('0xc')]=_[_0x4133('0xd')](config['redis'],{'host':_0x4133('0xe'),'port':0x18eb});var socket=require(_0x4133('0xf'))(new Redis(config[_0x4133('0xc')]));require(_0x4133('0x10'))[_0x4133('0x11')](socket);function respondWithRpcPromise(_0x1ffca3,_0x593bf1,_0x22db52){return new BPromise(function(_0x3b4ab4,_0x47dd1c){return client[_0x4133('0x12')](_0x1ffca3,_0x22db52)[_0x4133('0x13')](function(_0x53868c){logger[_0x4133('0x14')](_0x4133('0x15'),_0x593bf1,_0x4133('0x16'));logger[_0x4133('0x17')](_0x4133('0x18'),_0x593bf1,_0x4133('0x16'),JSON[_0x4133('0x19')](_0x53868c));if(_0x53868c[_0x4133('0x1a')]){if(_0x53868c[_0x4133('0x1a')][_0x4133('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x593bf1,_0x53868c[_0x4133('0x1a')][_0x4133('0x1c')]);return _0x47dd1c(_0x53868c[_0x4133('0x1a')][_0x4133('0x1c')]);}logger[_0x4133('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x593bf1,_0x53868c[_0x4133('0x1a')][_0x4133('0x1c')]);return _0x3b4ab4(_0x53868c[_0x4133('0x1a')][_0x4133('0x1c')]);}else{logger[_0x4133('0x14')](_0x4133('0x15'),_0x593bf1,'request\x20sent');_0x3b4ab4(_0x53868c[_0x4133('0x1d')][_0x4133('0x1c')]);}})['catch'](function(_0x1f04ef){logger['error'](_0x4133('0x15'),_0x593bf1,_0x1f04ef);_0x47dd1c(_0x1f04ef);});});}exports[_0x4133('0x1e')]=function(_0x18c0e5){var _0x107661=this;return new Promise(function(_0x4a0bf2,_0x4abc4c){return db[_0x4133('0x1f')][_0x4133('0x20')](_0x18c0e5[_0x4133('0x21')],{'raw':_0x18c0e5[_0x4133('0x22')]?_0x18c0e5[_0x4133('0x22')][_0x4133('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18c0e5[_0x4133('0x22')]?_0x18c0e5[_0x4133('0x22')][_0x4133('0x24')]||null:null,'attributes':_0x18c0e5[_0x4133('0x22')]?_0x18c0e5[_0x4133('0x22')]['attributes']||null:null,'limit':_0x18c0e5[_0x4133('0x22')]?_0x18c0e5[_0x4133('0x22')]['limit']||null:null})['then'](function(_0x39203f){logger[_0x4133('0x14')](_0x4133('0x1e'),_0x18c0e5);logger[_0x4133('0x17')](_0x4133('0x1e'),_0x18c0e5,JSON[_0x4133('0x19')](_0x39203f));_0x4a0bf2(_0x39203f);})[_0x4133('0x25')](function(_0x4f8a6c){logger['error'](_0x4133('0x1e'),_0x4f8a6c[_0x4133('0x1c')],_0x18c0e5);_0x4abc4c(_0x107661[_0x4133('0x1a')](0x1f4,_0x4f8a6c[_0x4133('0x1c')]));});});};exports[_0x4133('0x26')]=function(_0x56569b){return new Promise(function(_0x13d50c,_0x412120){return db[_0x4133('0x1f')][_0x4133('0x27')]({'where':_0x56569b[_0x4133('0x22')]?_0x56569b[_0x4133('0x22')]['where']||null:null})[_0x4133('0x13')](function(_0x961752){if(_0x961752){return _0x961752[_0x4133('0x28')](_0x56569b[_0x4133('0x21')][_0x4133('0x29')],_[_0x4133('0x2a')](_0x56569b['body'],[_0x4133('0x29'),'id'])||{});}})[_0x4133('0x2b')](function(_0x4ccdee){logger[_0x4133('0x14')](_0x4133('0x2c'),_0x56569b);logger['debug'](_0x4133('0x2c'),_0x56569b,JSON[_0x4133('0x19')](_0x4ccdee));_0x13d50c(_0x4ccdee);})[_0x4133('0x25')](function(_0x17cc4b){logger[_0x4133('0x1a')]('AddTags',_0x17cc4b[_0x4133('0x1c')],_0x56569b);_0x412120(_this[_0x4133('0x1a')](0x1f4,_0x17cc4b[_0x4133('0x1c')]));});});};
\ No newline at end of file