Built motion from commit cb845558.|2.6.34
[motion2.git] / server / api / chatInteraction / chatInteraction.rpc.js
index d5cc615..07e5de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x786f=['info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x2b74c8,_0x82f97f){var _0x339692=function(_0x5d07f4){while(--_0x5d07f4){_0x2b74c8['push'](_0x2b74c8['shift']());}};_0x339692(++_0x82f97f);}(_0x786f,0x9c));var _0xf786=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x786f[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0xf786('0x0'));var util=require(_0xf786('0x1'));var moment=require(_0xf786('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf786('0x3'));var db=require(_0xf786('0x4'))['db'];var utils=require(_0xf786('0x5'));var logger=require(_0xf786('0x6'))(_0xf786('0x7'));var config=require(_0xf786('0x8'));var jayson=require(_0xf786('0x9'));var client=jayson[_0xf786('0xa')][_0xf786('0xb')]({'port':0x232a});config[_0xf786('0xc')]=_[_0xf786('0xd')](config[_0xf786('0xc')],{'host':_0xf786('0xe'),'port':0x18eb});var socket=require(_0xf786('0xf'))(new Redis(config[_0xf786('0xc')]));require(_0xf786('0x10'))[_0xf786('0x11')](socket);function respondWithRpcPromise(_0x4340c2,_0xbd312,_0x48d823){return new BPromise(function(_0x444796,_0x2ec530){return client[_0xf786('0x12')](_0x4340c2,_0x48d823)[_0xf786('0x13')](function(_0x2c3b55){logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');logger[_0xf786('0x16')](_0xf786('0x17'),_0xbd312,'request\x20sent',JSON[_0xf786('0x18')](_0x2c3b55));if(_0x2c3b55[_0xf786('0x19')]){if(_0x2c3b55[_0xf786('0x19')]['code']===0x1f4){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x2ec530(_0x2c3b55[_0xf786('0x19')][_0xf786('0x1a')]);}logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x2c3b55[_0xf786('0x19')]['message']);return _0x444796(_0x2c3b55[_0xf786('0x19')]['message']);}else{logger[_0xf786('0x14')](_0xf786('0x15'),_0xbd312,'request\x20sent');_0x444796(_0x2c3b55['result'][_0xf786('0x1a')]);}})['catch'](function(_0x12bd62){logger[_0xf786('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xbd312,_0x12bd62);_0x2ec530(_0x12bd62);});});}exports[_0xf786('0x1b')]=function(_0x47d546){var _0x126d59=this;return new Promise(function(_0x34bd2f,_0x1345ee){return db[_0xf786('0x1c')][_0xf786('0x1d')](_0x47d546[_0xf786('0x1e')],{'raw':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x21')]||null:null,'attributes':_0x47d546['options']?_0x47d546[_0xf786('0x1f')][_0xf786('0x22')]||null:null,'limit':_0x47d546[_0xf786('0x1f')]?_0x47d546[_0xf786('0x1f')][_0xf786('0x23')]||null:null})[_0xf786('0x13')](function(_0x3dfb89){logger[_0xf786('0x14')](_0xf786('0x1b'),_0x47d546);logger['debug'](_0xf786('0x1b'),_0x47d546,JSON[_0xf786('0x18')](_0x3dfb89));_0x34bd2f(_0x3dfb89);})[_0xf786('0x24')](function(_0x4c19b9){logger['error'](_0xf786('0x1b'),_0x4c19b9[_0xf786('0x1a')],_0x47d546);_0x1345ee(_0x126d59['error'](0x1f4,_0x4c19b9[_0xf786('0x1a')]));});});};exports[_0xf786('0x25')]=function(_0x1dae8d){return new Promise(function(_0x525e8f,_0x4d6f69){return db['ChatInteraction'][_0xf786('0x26')]({'where':_0x1dae8d['options']?_0x1dae8d[_0xf786('0x1f')][_0xf786('0x21')]||null:null})[_0xf786('0x13')](function(_0x564d11){if(_0x564d11){return _0x564d11[_0xf786('0x27')](_0x1dae8d[_0xf786('0x1e')][_0xf786('0x28')],_[_0xf786('0x29')](_0x1dae8d[_0xf786('0x1e')],['ids','id'])||{});}})[_0xf786('0x2a')](function(_0x24146c){logger['info'](_0xf786('0x2b'),_0x1dae8d);logger[_0xf786('0x16')](_0xf786('0x2b'),_0x1dae8d,JSON[_0xf786('0x18')](_0x24146c));_0x525e8f(_0x24146c);})[_0xf786('0x24')](function(_0x21eafb){logger[_0xf786('0x19')](_0xf786('0x2b'),_0x21eafb[_0xf786('0x1a')],_0x1dae8d);_0x4d6f69(_this[_0xf786('0x19')](0x1f4,_0x21eafb['message']));});});};
\ No newline at end of file
+var _0xfcb1=['omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','find','addTags','ids'];(function(_0x3bc3cf,_0x252ce9){var _0x2b66b3=function(_0x487930){while(--_0x487930){_0x3bc3cf['push'](_0x3bc3cf['shift']());}};_0x2b66b3(++_0x252ce9);}(_0xfcb1,0xaf));var _0x1fcb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcb1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1fcb('0x0'));var util=require(_0x1fcb('0x1'));var moment=require(_0x1fcb('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fcb('0x3'));var fs=require('fs');var Redis=require(_0x1fcb('0x4'));var db=require(_0x1fcb('0x5'))['db'];var utils=require(_0x1fcb('0x6'));var logger=require(_0x1fcb('0x7'))(_0x1fcb('0x8'));var config=require(_0x1fcb('0x9'));var jayson=require(_0x1fcb('0xa'));var client=jayson['client'][_0x1fcb('0xb')]({'port':0x232a});config[_0x1fcb('0xc')]=_[_0x1fcb('0xd')](config[_0x1fcb('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1fcb('0xe'))(new Redis(config[_0x1fcb('0xc')]));require(_0x1fcb('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ee0b4,_0x49a245,_0x802fb4){return new BPromise(function(_0x3f6003,_0x24859d){return client[_0x1fcb('0x10')](_0x5ee0b4,_0x802fb4)[_0x1fcb('0x11')](function(_0x106627){logger[_0x1fcb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x1fcb('0x13'));logger[_0x1fcb('0x14')](_0x1fcb('0x15'),_0x49a245,_0x1fcb('0x13'),JSON[_0x1fcb('0x16')](_0x106627));if(_0x106627[_0x1fcb('0x17')]){if(_0x106627[_0x1fcb('0x17')][_0x1fcb('0x18')]===0x1f4){logger['error'](_0x1fcb('0x19'),_0x49a245,_0x106627[_0x1fcb('0x17')][_0x1fcb('0x1a')]);return _0x24859d(_0x106627[_0x1fcb('0x17')]['message']);}logger[_0x1fcb('0x17')](_0x1fcb('0x19'),_0x49a245,_0x106627[_0x1fcb('0x17')]['message']);return _0x3f6003(_0x106627[_0x1fcb('0x17')][_0x1fcb('0x1a')]);}else{logger[_0x1fcb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x1fcb('0x13'));_0x3f6003(_0x106627[_0x1fcb('0x1b')][_0x1fcb('0x1a')]);}})[_0x1fcb('0x1c')](function(_0x364a50){logger[_0x1fcb('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x49a245,_0x364a50);_0x24859d(_0x364a50);});});}exports[_0x1fcb('0x1d')]=function(_0x145778){var _0x45b7d1=this;return new Promise(function(_0x466517,_0x599a3f){return db[_0x1fcb('0x1e')][_0x1fcb('0x1f')](_0x145778[_0x1fcb('0x20')],{'raw':_0x145778['options']?_0x145778['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x145778[_0x1fcb('0x21')]?_0x145778[_0x1fcb('0x21')][_0x1fcb('0x22')]||null:null,'attributes':_0x145778[_0x1fcb('0x21')]?_0x145778[_0x1fcb('0x21')][_0x1fcb('0x23')]||null:null,'limit':_0x145778[_0x1fcb('0x21')]?_0x145778['options'][_0x1fcb('0x24')]||null:null})['then'](function(_0x20e8dc){logger[_0x1fcb('0x12')](_0x1fcb('0x1d'),_0x145778);logger['debug']('UpdateChatInteraction',_0x145778,JSON[_0x1fcb('0x16')](_0x20e8dc));_0x466517(_0x20e8dc);})[_0x1fcb('0x1c')](function(_0x2344c4){logger[_0x1fcb('0x17')](_0x1fcb('0x1d'),_0x2344c4['message'],_0x145778);_0x599a3f(_0x45b7d1[_0x1fcb('0x17')](0x1f4,_0x2344c4[_0x1fcb('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x504037){return new Promise(function(_0x335c28,_0x509fdc){return db['ChatInteraction'][_0x1fcb('0x25')]({'where':_0x504037[_0x1fcb('0x21')]?_0x504037[_0x1fcb('0x21')][_0x1fcb('0x22')]||null:null})['then'](function(_0x4ce880){if(_0x4ce880){return _0x4ce880[_0x1fcb('0x26')](_0x504037[_0x1fcb('0x20')][_0x1fcb('0x27')],_[_0x1fcb('0x28')](_0x504037[_0x1fcb('0x20')],['ids','id'])||{});}})[_0x1fcb('0x29')](function(_0x2bb669){logger[_0x1fcb('0x12')]('AddTags',_0x504037);logger[_0x1fcb('0x14')](_0x1fcb('0x2a'),_0x504037,JSON['stringify'](_0x2bb669));_0x335c28(_0x2bb669);})[_0x1fcb('0x1c')](function(_0x10ddba){logger['error'](_0x1fcb('0x2a'),_0x10ddba[_0x1fcb('0x1a')],_0x504037);_0x509fdc(_this[_0x1fcb('0x17')](0x1f4,_0x10ddba[_0x1fcb('0x1a')]));});});};
\ No newline at end of file