Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 32441b4..6112140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d36=['stringify','code','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','request\x20sent','debug'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x4d36,0xc7));var _0x64d3=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x4d36[_0x2bddf9];return _0x3f3ae9;};'use strict';var _=require(_0x64d3('0x0'));var util=require(_0x64d3('0x1'));var moment=require(_0x64d3('0x2'));var BPromise=require(_0x64d3('0x3'));var rs=require(_0x64d3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64d3('0x5'))['db'];var utils=require(_0x64d3('0x6'));var logger=require('../../config/logger')(_0x64d3('0x7'));var config=require(_0x64d3('0x8'));var jayson=require(_0x64d3('0x9'));var client=jayson['client'][_0x64d3('0xa')]({'port':0x232a});config[_0x64d3('0xb')]=_[_0x64d3('0xc')](config[_0x64d3('0xb')],{'host':_0x64d3('0xd'),'port':0x18eb});var socket=require(_0x64d3('0xe'))(new Redis(config[_0x64d3('0xb')]));require(_0x64d3('0xf'))[_0x64d3('0x10')](socket);function respondWithRpcPromise(_0x5ddb3f,_0x5c365b,_0x11db94){return new BPromise(function(_0x112378,_0x2d78bd){return client[_0x64d3('0x11')](_0x5ddb3f,_0x11db94)['then'](function(_0x109ff5){logger[_0x64d3('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5c365b,_0x64d3('0x13'));logger[_0x64d3('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x5c365b,_0x64d3('0x13'),JSON[_0x64d3('0x15')](_0x109ff5));if(_0x109ff5['error']){if(_0x109ff5['error'][_0x64d3('0x16')]===0x1f4){logger[_0x64d3('0x17')](_0x64d3('0x18'),_0x5c365b,_0x109ff5[_0x64d3('0x17')][_0x64d3('0x19')]);return _0x2d78bd(_0x109ff5[_0x64d3('0x17')][_0x64d3('0x19')]);}logger[_0x64d3('0x17')](_0x64d3('0x18'),_0x5c365b,_0x109ff5[_0x64d3('0x17')][_0x64d3('0x19')]);return _0x112378(_0x109ff5['error'][_0x64d3('0x19')]);}else{logger[_0x64d3('0x12')](_0x64d3('0x18'),_0x5c365b,_0x64d3('0x13'));_0x112378(_0x109ff5[_0x64d3('0x1a')][_0x64d3('0x19')]);}})[_0x64d3('0x1b')](function(_0x195c45){logger[_0x64d3('0x17')](_0x64d3('0x18'),_0x5c365b,_0x195c45);_0x2d78bd(_0x195c45);});});}exports[_0x64d3('0x1c')]=function(_0xa454ca){var _0x1dd1dd=this;return new Promise(function(_0x183486,_0x5dc387){return db[_0x64d3('0x1d')][_0x64d3('0x1e')](_0xa454ca[_0x64d3('0x1f')],{'raw':_0xa454ca[_0x64d3('0x20')]?_0xa454ca[_0x64d3('0x20')][_0x64d3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa454ca[_0x64d3('0x20')]?_0xa454ca[_0x64d3('0x20')][_0x64d3('0x22')]||null:null,'attributes':_0xa454ca[_0x64d3('0x20')]?_0xa454ca[_0x64d3('0x20')][_0x64d3('0x23')]||null:null,'limit':_0xa454ca['options']?_0xa454ca[_0x64d3('0x20')][_0x64d3('0x24')]||null:null})[_0x64d3('0x25')](function(_0x307c74){logger[_0x64d3('0x12')](_0x64d3('0x1c'),_0xa454ca);logger[_0x64d3('0x14')](_0x64d3('0x1c'),_0xa454ca,JSON[_0x64d3('0x15')](_0x307c74));_0x183486(_0x307c74);})[_0x64d3('0x1b')](function(_0x2af21b){logger['error']('UpdateOpenchannelInteraction',_0x2af21b['message'],_0xa454ca);_0x5dc387(_0x1dd1dd[_0x64d3('0x17')](0x1f4,_0x2af21b[_0x64d3('0x19')]));});});};exports[_0x64d3('0x26')]=function(_0x54d2c3){return new Promise(function(_0x4d61da,_0x292284){return db['OpenchannelInteraction'][_0x64d3('0x27')]({'where':_0x54d2c3[_0x64d3('0x20')]?_0x54d2c3['options'][_0x64d3('0x22')]||null:null})['then'](function(_0x127761){if(_0x127761){return _0x127761['addTags'](_0x54d2c3[_0x64d3('0x1f')][_0x64d3('0x28')],_[_0x64d3('0x29')](_0x54d2c3[_0x64d3('0x1f')],[_0x64d3('0x28'),'id'])||{});}})[_0x64d3('0x2a')](function(_0x141254){logger[_0x64d3('0x12')](_0x64d3('0x2b'),_0x54d2c3);logger[_0x64d3('0x14')](_0x64d3('0x2b'),_0x54d2c3,JSON['stringify'](_0x141254));_0x4d61da(_0x141254);})[_0x64d3('0x1b')](function(_0x1953eb){logger[_0x64d3('0x17')](_0x64d3('0x2b'),_0x1953eb['message'],_0x54d2c3);_0x292284(_this[_0x64d3('0x17')](0x1f4,_0x1953eb['message']));});});};
\ No newline at end of file
+var _0xf944=['body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update'];(function(_0x1e1232,_0x575d4b){var _0x10d42d=function(_0x5a6c00){while(--_0x5a6c00){_0x1e1232['push'](_0x1e1232['shift']());}};_0x10d42d(++_0x575d4b);}(_0xf944,0xb5));var _0x4f94=function(_0x4ba2e1,_0x36efae){_0x4ba2e1=_0x4ba2e1-0x0;var _0x28ae3f=_0xf944[_0x4ba2e1];return _0x28ae3f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f94('0x0'));var BPromise=require(_0x4f94('0x1'));var rs=require(_0x4f94('0x2'));var fs=require('fs');var Redis=require(_0x4f94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f94('0x4'));var logger=require(_0x4f94('0x5'))(_0x4f94('0x6'));var config=require(_0x4f94('0x7'));var jayson=require(_0x4f94('0x8'));var client=jayson[_0x4f94('0x9')][_0x4f94('0xa')]({'port':0x232a});config[_0x4f94('0xb')]=_['defaults'](config[_0x4f94('0xb')],{'host':_0x4f94('0xc'),'port':0x18eb});var socket=require(_0x4f94('0xd'))(new Redis(config['redis']));require(_0x4f94('0xe'))[_0x4f94('0xf')](socket);function respondWithRpcPromise(_0x3a7bf7,_0x5c5005,_0x27b3d5){return new BPromise(function(_0x26a798,_0x59ea17){return client['request'](_0x3a7bf7,_0x27b3d5)['then'](function(_0x23e951){logger[_0x4f94('0x10')](_0x4f94('0x11'),_0x5c5005,_0x4f94('0x12'));logger[_0x4f94('0x13')](_0x4f94('0x14'),_0x5c5005,'request\x20sent',JSON[_0x4f94('0x15')](_0x23e951));if(_0x23e951[_0x4f94('0x16')]){if(_0x23e951[_0x4f94('0x16')]['code']===0x1f4){logger[_0x4f94('0x16')](_0x4f94('0x11'),_0x5c5005,_0x23e951[_0x4f94('0x16')][_0x4f94('0x17')]);return _0x59ea17(_0x23e951[_0x4f94('0x16')][_0x4f94('0x17')]);}logger[_0x4f94('0x16')](_0x4f94('0x11'),_0x5c5005,_0x23e951[_0x4f94('0x16')]['message']);return _0x26a798(_0x23e951['error'][_0x4f94('0x17')]);}else{logger[_0x4f94('0x10')](_0x4f94('0x11'),_0x5c5005,_0x4f94('0x12'));_0x26a798(_0x23e951[_0x4f94('0x18')][_0x4f94('0x17')]);}})[_0x4f94('0x19')](function(_0x58e552){logger[_0x4f94('0x16')](_0x4f94('0x11'),_0x5c5005,_0x58e552);_0x59ea17(_0x58e552);});});}exports[_0x4f94('0x1a')]=function(_0x3ad7dc){var _0x26a46d=this;return new Promise(function(_0x470121,_0x716135){return db[_0x4f94('0x1b')][_0x4f94('0x1c')](_0x3ad7dc[_0x4f94('0x1d')],{'raw':_0x3ad7dc['options']?_0x3ad7dc[_0x4f94('0x1e')][_0x4f94('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad7dc[_0x4f94('0x1e')]?_0x3ad7dc['options'][_0x4f94('0x20')]||null:null,'attributes':_0x3ad7dc[_0x4f94('0x1e')]?_0x3ad7dc[_0x4f94('0x1e')][_0x4f94('0x21')]||null:null,'limit':_0x3ad7dc[_0x4f94('0x1e')]?_0x3ad7dc[_0x4f94('0x1e')]['limit']||null:null})['then'](function(_0x52a8a4){logger['info'](_0x4f94('0x1a'),_0x3ad7dc);logger['debug']('UpdateOpenchannelInteraction',_0x3ad7dc,JSON[_0x4f94('0x15')](_0x52a8a4));_0x470121(_0x52a8a4);})['catch'](function(_0x2dd9a8){logger[_0x4f94('0x16')](_0x4f94('0x1a'),_0x2dd9a8[_0x4f94('0x17')],_0x3ad7dc);_0x716135(_0x26a46d['error'](0x1f4,_0x2dd9a8[_0x4f94('0x17')]));});});};exports[_0x4f94('0x22')]=function(_0x356db6){return new Promise(function(_0x1a3f41,_0x2f23e4){return db[_0x4f94('0x1b')][_0x4f94('0x23')]({'where':_0x356db6['options']?_0x356db6[_0x4f94('0x1e')][_0x4f94('0x20')]||null:null})[_0x4f94('0x24')](function(_0xc5678e){if(_0xc5678e){return _0xc5678e[_0x4f94('0x25')](_0x356db6[_0x4f94('0x1d')][_0x4f94('0x26')],_[_0x4f94('0x27')](_0x356db6['body'],['ids','id'])||{});}})[_0x4f94('0x28')](function(_0x326567){logger['info']('AddTags',_0x356db6);logger[_0x4f94('0x13')](_0x4f94('0x29'),_0x356db6,JSON[_0x4f94('0x15')](_0x326567));_0x1a3f41(_0x326567);})[_0x4f94('0x19')](function(_0x5bac6c){logger[_0x4f94('0x16')](_0x4f94('0x29'),_0x5bac6c[_0x4f94('0x17')],_0x356db6);_0x2f23e4(_this[_0x4f94('0x16')](0x1f4,_0x5bac6c[_0x4f94('0x17')]));});});};
\ No newline at end of file