Built motion from commit 0c5f406c.|2.6.29
[motion2.git] / server / api / trunk / trunk.rpc.js
index 736d7d6..2cfcc16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaf1=['then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrunk','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x574e9e,_0x5420ae){var _0x1bd83d=function(_0x1f340c){while(--_0x1f340c){_0x574e9e['push'](_0x574e9e['shift']());}};_0x1bd83d(++_0x5420ae);}(_0xaaf1,0x152));var _0x1aaf=function(_0x48588a,_0x16e318){_0x48588a=_0x48588a-0x0;var _0x467bbe=_0xaaf1[_0x48588a];return _0x467bbe;};'use strict';var _=require('lodash');var util=require(_0x1aaf('0x0'));var moment=require(_0x1aaf('0x1'));var BPromise=require(_0x1aaf('0x2'));var rs=require(_0x1aaf('0x3'));var fs=require('fs');var Redis=require(_0x1aaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1aaf('0x5'));var logger=require('../../config/logger')(_0x1aaf('0x6'));var config=require(_0x1aaf('0x7'));var jayson=require(_0x1aaf('0x8'));var client=jayson[_0x1aaf('0x9')][_0x1aaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189c7a,_0x490899,_0x4a0855){return new BPromise(function(_0x3c8460,_0x38447f){return client[_0x1aaf('0xb')](_0x189c7a,_0x4a0855)[_0x1aaf('0xc')](function(_0x47da95){logger[_0x1aaf('0xd')](_0x1aaf('0xe'),_0x490899,_0x1aaf('0xf'));logger[_0x1aaf('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x490899,'request\x20sent',JSON[_0x1aaf('0x11')](_0x47da95));if(_0x47da95[_0x1aaf('0x12')]){if(_0x47da95[_0x1aaf('0x12')]['code']===0x1f4){logger[_0x1aaf('0x12')](_0x1aaf('0xe'),_0x490899,_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);return _0x38447f(_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);}logger[_0x1aaf('0x12')](_0x1aaf('0xe'),_0x490899,_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);return _0x3c8460(_0x47da95[_0x1aaf('0x12')][_0x1aaf('0x13')]);}else{logger[_0x1aaf('0xd')](_0x1aaf('0xe'),_0x490899,_0x1aaf('0xf'));_0x3c8460(_0x47da95[_0x1aaf('0x14')][_0x1aaf('0x13')]);}})['catch'](function(_0x5d6c95){logger['error'](_0x1aaf('0xe'),_0x490899,_0x5d6c95);_0x38447f(_0x5d6c95);});});}exports[_0x1aaf('0x15')]=function(_0x125c43){var _0x1a5781=this;return new Promise(function(_0x3587fd,_0x5e513c){return db[_0x1aaf('0x16')][_0x1aaf('0x17')]({'raw':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x19')]===undefined?!![]:![]:!![],'where':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1a')]||null:null,'attributes':_0x125c43[_0x1aaf('0x18')]?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1b')]||null:null,'limit':_0x125c43[_0x1aaf('0x18')]?_0x125c43['options'][_0x1aaf('0x1c')]||null:null,'include':_0x125c43['options']?_0x125c43[_0x1aaf('0x18')][_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0x125c43['options'][_0x1aaf('0x1d')],function(_0x48bc45){return{'model':db[_0x48bc45[_0x1aaf('0x1f')]],'as':_0x48bc45['as'],'attributes':_0x48bc45[_0x1aaf('0x1b')],'include':_0x48bc45[_0x1aaf('0x1d')]?_['map'](_0x48bc45[_0x1aaf('0x1d')],function(_0x5d191f){return{'model':db[_0x5d191f['model']],'as':_0x5d191f['as'],'attributes':_0x5d191f['attributes'],'include':_0x5d191f['include']?_[_0x1aaf('0x1e')](_0x5d191f[_0x1aaf('0x1d')],function(_0x61a8bb){return{'model':db[_0x61a8bb['model']],'as':_0x61a8bb['as'],'attributes':_0x61a8bb[_0x1aaf('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43da30){logger['info']('GetTrunk',_0x125c43);logger[_0x1aaf('0x10')](_0x1aaf('0x15'),_0x125c43,JSON[_0x1aaf('0x11')](_0x43da30));_0x3587fd(_0x43da30);})[_0x1aaf('0x20')](function(_0xe40c08){logger[_0x1aaf('0x12')](_0x1aaf('0x15'),_0xe40c08['message'],_0x125c43);_0x5e513c(_0x1a5781[_0x1aaf('0x12')](0x1f4,_0xe40c08['message']));});});};exports[_0x1aaf('0x21')]=function(_0xe07da5){var _0x54d393=this;return new Promise(function(_0xe7d5cb,_0x36244b){return db[_0x1aaf('0x16')][_0x1aaf('0x22')]({'raw':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x19')]===undefined?!![]:![]:!![],'where':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')]['where']||null:null,'attributes':_0xe07da5[_0x1aaf('0x18')]?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1b')]||null:null,'include':_0xe07da5['options']?_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0xe07da5[_0x1aaf('0x18')][_0x1aaf('0x1d')],function(_0x5e0268){return{'model':db[_0x5e0268[_0x1aaf('0x1f')]],'as':_0x5e0268['as'],'attributes':_0x5e0268[_0x1aaf('0x1b')],'include':_0x5e0268['include']?_[_0x1aaf('0x1e')](_0x5e0268[_0x1aaf('0x1d')],function(_0x894822){return{'model':db[_0x894822[_0x1aaf('0x1f')]],'as':_0x894822['as'],'attributes':_0x894822['attributes'],'include':_0x894822[_0x1aaf('0x1d')]?_[_0x1aaf('0x1e')](_0x894822[_0x1aaf('0x1d')],function(_0x29ea9c){return{'model':db[_0x29ea9c['model']],'as':_0x29ea9c['as'],'attributes':_0x29ea9c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1aaf('0xc')](function(_0x1a792f){logger[_0x1aaf('0xd')]('ShowTrunk',_0xe07da5);logger[_0x1aaf('0x10')]('ShowTrunk',_0xe07da5,JSON[_0x1aaf('0x11')](_0x1a792f));_0xe7d5cb(_0x1a792f);})[_0x1aaf('0x20')](function(_0x54d4aa){logger[_0x1aaf('0x12')](_0x1aaf('0x21'),_0x54d4aa[_0x1aaf('0x13')],_0xe07da5);_0x36244b(_0x54d393[_0x1aaf('0x12')](0x1f4,_0x54d4aa[_0x1aaf('0x13')]));});});};
\ No newline at end of file
+var _0xedb4=['debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','Trunk','findAll','options','raw','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','find','where','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s'];(function(_0x5e7c51,_0x16e1ce){var _0x1480b8=function(_0x1eeb25){while(--_0x1eeb25){_0x5e7c51['push'](_0x5e7c51['shift']());}};_0x1480b8(++_0x16e1ce);}(_0xedb4,0x15b));var _0x4edb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xedb4[_0x4e1a49];return _0x136aae;};'use strict';var _=require(_0x4edb('0x0'));var util=require(_0x4edb('0x1'));var moment=require('moment');var BPromise=require(_0x4edb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4edb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4edb('0x4'));var logger=require(_0x4edb('0x5'))(_0x4edb('0x6'));var config=require(_0x4edb('0x7'));var jayson=require(_0x4edb('0x8'));var client=jayson[_0x4edb('0x9')][_0x4edb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e7e63,_0x2d9c75,_0x5a5313){return new BPromise(function(_0x2ef986,_0x1b688b){return client[_0x4edb('0xb')](_0x1e7e63,_0x5a5313)['then'](function(_0x568fdd){logger['info'](_0x4edb('0xc'),_0x2d9c75,'request\x20sent');logger[_0x4edb('0xd')](_0x4edb('0xe'),_0x2d9c75,_0x4edb('0xf'),JSON[_0x4edb('0x10')](_0x568fdd));if(_0x568fdd[_0x4edb('0x11')]){if(_0x568fdd['error'][_0x4edb('0x12')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x1b688b(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}logger['error'](_0x4edb('0xc'),_0x2d9c75,_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);return _0x2ef986(_0x568fdd[_0x4edb('0x11')][_0x4edb('0x13')]);}else{logger[_0x4edb('0x14')](_0x4edb('0xc'),_0x2d9c75,_0x4edb('0xf'));_0x2ef986(_0x568fdd['result'][_0x4edb('0x13')]);}})[_0x4edb('0x15')](function(_0x1affb9){logger[_0x4edb('0x11')](_0x4edb('0xc'),_0x2d9c75,_0x1affb9);_0x1b688b(_0x1affb9);});});}exports['GetTrunk']=function(_0x49a8b6){var _0x5aca17=this;return new Promise(function(_0x2cc18b,_0x2cf6c3){return db[_0x4edb('0x16')][_0x4edb('0x17')]({'raw':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x19')]===undefined?!![]:![]:!![],'where':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')]['where']||null:null,'attributes':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6['options'][_0x4edb('0x1a')]||null:null,'limit':_0x49a8b6[_0x4edb('0x18')]?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1b')]||null:null,'include':_0x49a8b6['options']?_0x49a8b6[_0x4edb('0x18')][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x49a8b6['options']['include'],function(_0xb3a03f){return{'model':db[_0xb3a03f[_0x4edb('0x1e')]],'as':_0xb3a03f['as'],'attributes':_0xb3a03f[_0x4edb('0x1a')],'include':_0xb3a03f[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0xb3a03f[_0x4edb('0x1c')],function(_0x56e02d){return{'model':db[_0x56e02d[_0x4edb('0x1e')]],'as':_0x56e02d['as'],'attributes':_0x56e02d['attributes'],'include':_0x56e02d['include']?_['map'](_0x56e02d[_0x4edb('0x1c')],function(_0xd72ed9){return{'model':db[_0xd72ed9[_0x4edb('0x1e')]],'as':_0xd72ed9['as'],'attributes':_0xd72ed9[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x581453){logger['info'](_0x4edb('0x20'),_0x49a8b6);logger[_0x4edb('0xd')](_0x4edb('0x20'),_0x49a8b6,JSON[_0x4edb('0x10')](_0x581453));_0x2cc18b(_0x581453);})[_0x4edb('0x15')](function(_0x3c647f){logger['error'](_0x4edb('0x20'),_0x3c647f[_0x4edb('0x13')],_0x49a8b6);_0x2cf6c3(_0x5aca17[_0x4edb('0x11')](0x1f4,_0x3c647f[_0x4edb('0x13')]));});});};exports[_0x4edb('0x21')]=function(_0x1a3345){var _0x43e142=this;return new Promise(function(_0x4423c8,_0x53c428){return db[_0x4edb('0x16')][_0x4edb('0x22')]({'raw':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a3345[_0x4edb('0x18')]?_0x1a3345[_0x4edb('0x18')][_0x4edb('0x23')]||null:null,'attributes':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1a')]||null:null,'include':_0x1a3345[_0x4edb('0x18')]?_0x1a3345['options'][_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x1a3345[_0x4edb('0x18')][_0x4edb('0x1c')],function(_0x2a3147){return{'model':db[_0x2a3147[_0x4edb('0x1e')]],'as':_0x2a3147['as'],'attributes':_0x2a3147[_0x4edb('0x1a')],'include':_0x2a3147['include']?_[_0x4edb('0x1d')](_0x2a3147[_0x4edb('0x1c')],function(_0x3f748a){return{'model':db[_0x3f748a[_0x4edb('0x1e')]],'as':_0x3f748a['as'],'attributes':_0x3f748a[_0x4edb('0x1a')],'include':_0x3f748a[_0x4edb('0x1c')]?_[_0x4edb('0x1d')](_0x3f748a[_0x4edb('0x1c')],function(_0xe81b4b){return{'model':db[_0xe81b4b[_0x4edb('0x1e')]],'as':_0xe81b4b['as'],'attributes':_0xe81b4b[_0x4edb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4edb('0x1f')](function(_0x2c6821){logger[_0x4edb('0x14')]('ShowTrunk',_0x1a3345);logger[_0x4edb('0xd')](_0x4edb('0x21'),_0x1a3345,JSON[_0x4edb('0x10')](_0x2c6821));_0x4423c8(_0x2c6821);})['catch'](function(_0x999808){logger[_0x4edb('0x11')](_0x4edb('0x21'),_0x999808['message'],_0x1a3345);_0x53c428(_0x43e142[_0x4edb('0x11')](0x1f4,_0x999808[_0x4edb('0x13')]));});});};
\ No newline at end of file