Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.rpc.js
index 9bcf644..1c91c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa174=['error','code','message','catch','OpenchannelInteraction','update','options','where','attributes','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xa174,0x1a3));var _0x4a17=function(_0x4fffbe,_0x55f67e){_0x4fffbe=_0x4fffbe-0x0;var _0x405831=_0xa174[_0x4fffbe];return _0x405831;};'use strict';var _=require(_0x4a17('0x0'));var util=require(_0x4a17('0x1'));var moment=require(_0x4a17('0x2'));var BPromise=require(_0x4a17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a17('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4a17('0x6'));var jayson=require(_0x4a17('0x7'));var client=jayson[_0x4a17('0x8')][_0x4a17('0x9')]({'port':0x232a});config[_0x4a17('0xa')]=_[_0x4a17('0xb')](config['redis'],{'host':_0x4a17('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a17('0xa')]));require(_0x4a17('0xd'))[_0x4a17('0xe')](socket);function respondWithRpcPromise(_0x196fde,_0xf12129,_0x54f63c){return new BPromise(function(_0x1db3f2,_0x4e0c08){return client['request'](_0x196fde,_0x54f63c)['then'](function(_0x2e19cb){logger[_0x4a17('0xf')](_0x4a17('0x10'),_0xf12129,_0x4a17('0x11'));logger[_0x4a17('0x12')](_0x4a17('0x13'),_0xf12129,'request\x20sent',JSON[_0x4a17('0x14')](_0x2e19cb));if(_0x2e19cb[_0x4a17('0x15')]){if(_0x2e19cb[_0x4a17('0x15')][_0x4a17('0x16')]===0x1f4){logger[_0x4a17('0x15')](_0x4a17('0x10'),_0xf12129,_0x2e19cb[_0x4a17('0x15')][_0x4a17('0x17')]);return _0x4e0c08(_0x2e19cb[_0x4a17('0x15')][_0x4a17('0x17')]);}logger[_0x4a17('0x15')](_0x4a17('0x10'),_0xf12129,_0x2e19cb['error']['message']);return _0x1db3f2(_0x2e19cb[_0x4a17('0x15')]['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xf12129,_0x4a17('0x11'));_0x1db3f2(_0x2e19cb['result']['message']);}})[_0x4a17('0x18')](function(_0x64af5f){logger[_0x4a17('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xf12129,_0x64af5f);_0x4e0c08(_0x64af5f);});});}exports['UpdateOpenchannelInteraction']=function(_0x5d64ea){var _0x4cf309=this;return new Promise(function(_0x1f8d46,_0x27ae98){return db[_0x4a17('0x19')][_0x4a17('0x1a')](_0x5d64ea['body'],{'raw':_0x5d64ea[_0x4a17('0x1b')]?_0x5d64ea[_0x4a17('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d64ea[_0x4a17('0x1b')]?_0x5d64ea[_0x4a17('0x1b')][_0x4a17('0x1c')]||null:null,'attributes':_0x5d64ea[_0x4a17('0x1b')]?_0x5d64ea[_0x4a17('0x1b')][_0x4a17('0x1d')]||null:null,'limit':_0x5d64ea['options']?_0x5d64ea[_0x4a17('0x1b')]['limit']||null:null})[_0x4a17('0x1e')](function(_0x27d99d){logger[_0x4a17('0xf')](_0x4a17('0x1f'),_0x5d64ea);logger[_0x4a17('0x12')](_0x4a17('0x1f'),_0x5d64ea,JSON[_0x4a17('0x14')](_0x27d99d));_0x1f8d46(_0x27d99d);})[_0x4a17('0x18')](function(_0x24965e){logger[_0x4a17('0x15')]('UpdateOpenchannelInteraction',_0x24965e[_0x4a17('0x17')],_0x5d64ea);_0x27ae98(_0x4cf309['error'](0x1f4,_0x24965e[_0x4a17('0x17')]));});});};exports[_0x4a17('0x20')]=function(_0x5ed8c2){return new Promise(function(_0x33a77b,_0x2df8c2){return db['OpenchannelInteraction'][_0x4a17('0x21')]({'where':_0x5ed8c2[_0x4a17('0x1b')]?_0x5ed8c2[_0x4a17('0x1b')][_0x4a17('0x1c')]||null:null})[_0x4a17('0x1e')](function(_0x5bde1e){if(_0x5bde1e){return _0x5bde1e[_0x4a17('0x22')](_0x5ed8c2[_0x4a17('0x23')][_0x4a17('0x24')],_[_0x4a17('0x25')](_0x5ed8c2[_0x4a17('0x23')],[_0x4a17('0x24'),'id'])||{});}})[_0x4a17('0x26')](function(_0xeb205d){logger[_0x4a17('0xf')](_0x4a17('0x27'),_0x5ed8c2);logger[_0x4a17('0x12')](_0x4a17('0x27'),_0x5ed8c2,JSON[_0x4a17('0x14')](_0xeb205d));_0x33a77b(_0xeb205d);})[_0x4a17('0x18')](function(_0x406f25){logger[_0x4a17('0x15')](_0x4a17('0x27'),_0x406f25[_0x4a17('0x17')],_0x5ed8c2);_0x2df8c2(_this[_0x4a17('0x15')](0x1f4,_0x406f25[_0x4a17('0x17')]));});});};
\ No newline at end of file
+var _0x5170=['addTags','ids','omit','spread','AddTags','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','OpenchannelInteraction','body','options','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find'];(function(_0x48c518,_0x198466){var _0x1899c4=function(_0x44fad1){while(--_0x44fad1){_0x48c518['push'](_0x48c518['shift']());}};_0x1899c4(++_0x198466);}(_0x5170,0x19f));var _0x0517=function(_0x85fb1d,_0x91e4c9){_0x85fb1d=_0x85fb1d-0x0;var _0x21c228=_0x5170[_0x85fb1d];return _0x21c228;};'use strict';var _=require('lodash');var util=require(_0x0517('0x0'));var moment=require(_0x0517('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0517('0x2'));var db=require(_0x0517('0x3'))['db'];var utils=require(_0x0517('0x4'));var logger=require(_0x0517('0x5'))(_0x0517('0x6'));var config=require(_0x0517('0x7'));var jayson=require(_0x0517('0x8'));var client=jayson[_0x0517('0x9')][_0x0517('0xa')]({'port':0x232a});config[_0x0517('0xb')]=_[_0x0517('0xc')](config[_0x0517('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0517('0xd'))(new Redis(config['redis']));require(_0x0517('0xe'))[_0x0517('0xf')](socket);function respondWithRpcPromise(_0xc89c15,_0x422a20,_0x4ef9e9){return new BPromise(function(_0x3e1ef9,_0x17422e){return client[_0x0517('0x10')](_0xc89c15,_0x4ef9e9)[_0x0517('0x11')](function(_0x181175){logger[_0x0517('0x12')](_0x0517('0x13'),_0x422a20,_0x0517('0x14'));logger[_0x0517('0x15')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x422a20,_0x0517('0x14'),JSON[_0x0517('0x16')](_0x181175));if(_0x181175['error']){if(_0x181175[_0x0517('0x17')][_0x0517('0x18')]===0x1f4){logger[_0x0517('0x17')](_0x0517('0x13'),_0x422a20,_0x181175[_0x0517('0x17')][_0x0517('0x19')]);return _0x17422e(_0x181175['error'][_0x0517('0x19')]);}logger[_0x0517('0x17')](_0x0517('0x13'),_0x422a20,_0x181175[_0x0517('0x17')]['message']);return _0x3e1ef9(_0x181175[_0x0517('0x17')][_0x0517('0x19')]);}else{logger[_0x0517('0x12')](_0x0517('0x13'),_0x422a20,_0x0517('0x14'));_0x3e1ef9(_0x181175['result'][_0x0517('0x19')]);}})[_0x0517('0x1a')](function(_0x52d8a8){logger[_0x0517('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x422a20,_0x52d8a8);_0x17422e(_0x52d8a8);});});}exports['UpdateOpenchannelInteraction']=function(_0x54a766){var _0x3c4767=this;return new Promise(function(_0x35bc7c,_0x21b920){return db[_0x0517('0x1b')]['update'](_0x54a766[_0x0517('0x1c')],{'raw':_0x54a766[_0x0517('0x1d')]?_0x54a766[_0x0517('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a766[_0x0517('0x1d')]?_0x54a766[_0x0517('0x1d')][_0x0517('0x1e')]||null:null,'attributes':_0x54a766[_0x0517('0x1d')]?_0x54a766[_0x0517('0x1d')][_0x0517('0x1f')]||null:null,'limit':_0x54a766['options']?_0x54a766['options'][_0x0517('0x20')]||null:null})[_0x0517('0x11')](function(_0x3e3d77){logger[_0x0517('0x12')](_0x0517('0x21'),_0x54a766);logger[_0x0517('0x15')](_0x0517('0x21'),_0x54a766,JSON['stringify'](_0x3e3d77));_0x35bc7c(_0x3e3d77);})[_0x0517('0x1a')](function(_0x5ef11c){logger[_0x0517('0x17')](_0x0517('0x21'),_0x5ef11c[_0x0517('0x19')],_0x54a766);_0x21b920(_0x3c4767[_0x0517('0x17')](0x1f4,_0x5ef11c[_0x0517('0x19')]));});});};exports[_0x0517('0x22')]=function(_0x444b23){return new Promise(function(_0x20cd36,_0x19dc65){return db[_0x0517('0x1b')][_0x0517('0x23')]({'where':_0x444b23[_0x0517('0x1d')]?_0x444b23[_0x0517('0x1d')][_0x0517('0x1e')]||null:null})[_0x0517('0x11')](function(_0x23504a){if(_0x23504a){return _0x23504a[_0x0517('0x24')](_0x444b23[_0x0517('0x1c')][_0x0517('0x25')],_[_0x0517('0x26')](_0x444b23[_0x0517('0x1c')],[_0x0517('0x25'),'id'])||{});}})[_0x0517('0x27')](function(_0x38fb1f){logger[_0x0517('0x12')](_0x0517('0x28'),_0x444b23);logger['debug'](_0x0517('0x28'),_0x444b23,JSON['stringify'](_0x38fb1f));_0x20cd36(_0x38fb1f);})['catch'](function(_0x22475b){logger['error'](_0x0517('0x28'),_0x22475b[_0x0517('0x19')],_0x444b23);_0x19dc65(_this['error'](0x1f4,_0x22475b[_0x0517('0x19')]));});});};
\ No newline at end of file