Built motion from commit 5ae82ce5.|2.6.7
[motion2.git] / server / api / trunk / trunk.rpc.js
index d9f8878..f0c9d82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf878=['debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','options','raw','where','attributes','include','map','model','find','ShowTrunk','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent'];(function(_0x16539a,_0x31409a){var _0x200796=function(_0xfe7803){while(--_0xfe7803){_0x16539a['push'](_0x16539a['shift']());}};_0x200796(++_0x31409a);}(_0xf878,0xdf));var _0x8f87=function(_0x9c25a3,_0x272bc0){_0x9c25a3=_0x9c25a3-0x0;var _0x2572e6=_0xf878[_0x9c25a3];return _0x2572e6;};'use strict';var _=require(_0x8f87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8f87('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8f87('0x2'));var db=require(_0x8f87('0x3'))['db'];var utils=require(_0x8f87('0x4'));var logger=require(_0x8f87('0x5'))(_0x8f87('0x6'));var config=require(_0x8f87('0x7'));var jayson=require(_0x8f87('0x8'));var client=jayson['client'][_0x8f87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14b0e9,_0x3b35aa,_0x4034b3){return new BPromise(function(_0x14c9c0,_0x3480af){return client[_0x8f87('0xa')](_0x14b0e9,_0x4034b3)[_0x8f87('0xb')](function(_0x306048){logger[_0x8f87('0xc')](_0x8f87('0xd'),_0x3b35aa,_0x8f87('0xe'));logger[_0x8f87('0xf')](_0x8f87('0x10'),_0x3b35aa,_0x8f87('0xe'),JSON[_0x8f87('0x11')](_0x306048));if(_0x306048[_0x8f87('0x12')]){if(_0x306048[_0x8f87('0x12')][_0x8f87('0x13')]===0x1f4){logger['error'](_0x8f87('0xd'),_0x3b35aa,_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);return _0x3480af(_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);}logger[_0x8f87('0x12')](_0x8f87('0xd'),_0x3b35aa,_0x306048['error']['message']);return _0x14c9c0(_0x306048[_0x8f87('0x12')][_0x8f87('0x14')]);}else{logger['info'](_0x8f87('0xd'),_0x3b35aa,_0x8f87('0xe'));_0x14c9c0(_0x306048[_0x8f87('0x15')]['message']);}})['catch'](function(_0x5de382){logger[_0x8f87('0x12')]('Trunk,\x20%s,\x20%s',_0x3b35aa,_0x5de382);_0x3480af(_0x5de382);});});}exports[_0x8f87('0x16')]=function(_0x3ba09c){var _0xfe60a8=this;return new Promise(function(_0x29ae45,_0x2d63c7){return db[_0x8f87('0x17')]['findAll']({'raw':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x19')]===undefined?!![]:![]:!![],'where':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x1a')]||null:null,'attributes':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c['options'][_0x8f87('0x1b')]||null:null,'limit':_0x3ba09c[_0x8f87('0x18')]?_0x3ba09c[_0x8f87('0x18')]['limit']||null:null,'include':_0x3ba09c['options']?_0x3ba09c['options'][_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x3ba09c[_0x8f87('0x18')][_0x8f87('0x1c')],function(_0x1beb43){return{'model':db[_0x1beb43[_0x8f87('0x1e')]],'as':_0x1beb43['as'],'attributes':_0x1beb43['attributes'],'include':_0x1beb43[_0x8f87('0x1c')]?_['map'](_0x1beb43[_0x8f87('0x1c')],function(_0xcfced3){return{'model':db[_0xcfced3[_0x8f87('0x1e')]],'as':_0xcfced3['as'],'attributes':_0xcfced3[_0x8f87('0x1b')],'include':_0xcfced3[_0x8f87('0x1c')]?_['map'](_0xcfced3[_0x8f87('0x1c')],function(_0x1a32bf){return{'model':db[_0x1a32bf[_0x8f87('0x1e')]],'as':_0x1a32bf['as'],'attributes':_0x1a32bf[_0x8f87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8f87('0xb')](function(_0xaa2b4d){logger[_0x8f87('0xc')]('GetTrunk',_0x3ba09c);logger[_0x8f87('0xf')](_0x8f87('0x16'),_0x3ba09c,JSON[_0x8f87('0x11')](_0xaa2b4d));_0x29ae45(_0xaa2b4d);})['catch'](function(_0x3ed5ce){logger['error'](_0x8f87('0x16'),_0x3ed5ce[_0x8f87('0x14')],_0x3ba09c);_0x2d63c7(_0xfe60a8[_0x8f87('0x12')](0x1f4,_0x3ed5ce[_0x8f87('0x14')]));});});};exports['ShowTrunk']=function(_0x11a714){var _0x5adf6d=this;return new Promise(function(_0x475f7c,_0x2dc71e){return db[_0x8f87('0x17')][_0x8f87('0x1f')]({'raw':_0x11a714['options']?_0x11a714['options'][_0x8f87('0x19')]===undefined?!![]:![]:!![],'where':_0x11a714[_0x8f87('0x18')]?_0x11a714[_0x8f87('0x18')]['where']||null:null,'attributes':_0x11a714['options']?_0x11a714[_0x8f87('0x18')][_0x8f87('0x1b')]||null:null,'include':_0x11a714['options']?_0x11a714[_0x8f87('0x18')][_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x11a714[_0x8f87('0x18')][_0x8f87('0x1c')],function(_0xa0d6ef){return{'model':db[_0xa0d6ef[_0x8f87('0x1e')]],'as':_0xa0d6ef['as'],'attributes':_0xa0d6ef[_0x8f87('0x1b')],'include':_0xa0d6ef[_0x8f87('0x1c')]?_['map'](_0xa0d6ef[_0x8f87('0x1c')],function(_0x5dcaef){return{'model':db[_0x5dcaef['model']],'as':_0x5dcaef['as'],'attributes':_0x5dcaef['attributes'],'include':_0x5dcaef[_0x8f87('0x1c')]?_[_0x8f87('0x1d')](_0x5dcaef['include'],function(_0x5e7cac){return{'model':db[_0x5e7cac[_0x8f87('0x1e')]],'as':_0x5e7cac['as'],'attributes':_0x5e7cac[_0x8f87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8f87('0xb')](function(_0x5dd180){logger[_0x8f87('0xc')](_0x8f87('0x20'),_0x11a714);logger[_0x8f87('0xf')]('ShowTrunk',_0x11a714,JSON[_0x8f87('0x11')](_0x5dd180));_0x475f7c(_0x5dd180);})[_0x8f87('0x21')](function(_0x26e0df){logger[_0x8f87('0x12')](_0x8f87('0x20'),_0x26e0df[_0x8f87('0x14')],_0x11a714);_0x2dc71e(_0x5adf6d[_0x8f87('0x12')](0x1f4,_0x26e0df[_0x8f87('0x14')]));});});};
\ No newline at end of file
+var _0x6467=['Trunk','findAll','raw','options','where','attributes','limit','include','map','model','stringify','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrunk'];(function(_0x2cbea1,_0x2cd722){var _0x4682f9=function(_0x4a9a4a){while(--_0x4a9a4a){_0x2cbea1['push'](_0x2cbea1['shift']());}};_0x4682f9(++_0x2cd722);}(_0x6467,0x110));var _0x7646=function(_0x35a1ce,_0x5d1934){_0x35a1ce=_0x35a1ce-0x0;var _0x4e18f9=_0x6467[_0x35a1ce];return _0x4e18f9;};'use strict';var _=require(_0x7646('0x0'));var util=require(_0x7646('0x1'));var moment=require(_0x7646('0x2'));var BPromise=require(_0x7646('0x3'));var rs=require(_0x7646('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7646('0x5'));var logger=require(_0x7646('0x6'))(_0x7646('0x7'));var config=require(_0x7646('0x8'));var jayson=require(_0x7646('0x9'));var client=jayson[_0x7646('0xa')][_0x7646('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40c136,_0x151ed6,_0x5023ae){return new BPromise(function(_0x241fe5,_0x10d4c5){return client[_0x7646('0xc')](_0x40c136,_0x5023ae)[_0x7646('0xd')](function(_0xf921c6){logger[_0x7646('0xe')](_0x7646('0xf'),_0x151ed6,_0x7646('0x10'));logger[_0x7646('0x11')](_0x7646('0x12'),_0x151ed6,'request\x20sent',JSON['stringify'](_0xf921c6));if(_0xf921c6['error']){if(_0xf921c6[_0x7646('0x13')][_0x7646('0x14')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x151ed6,_0xf921c6['error']['message']);return _0x10d4c5(_0xf921c6[_0x7646('0x13')][_0x7646('0x15')]);}logger[_0x7646('0x13')](_0x7646('0xf'),_0x151ed6,_0xf921c6['error']['message']);return _0x241fe5(_0xf921c6[_0x7646('0x13')][_0x7646('0x15')]);}else{logger['info'](_0x7646('0xf'),_0x151ed6,_0x7646('0x10'));_0x241fe5(_0xf921c6[_0x7646('0x16')]['message']);}})['catch'](function(_0x4c0d1d){logger['error']('Trunk,\x20%s,\x20%s',_0x151ed6,_0x4c0d1d);_0x10d4c5(_0x4c0d1d);});});}exports[_0x7646('0x17')]=function(_0x2b038e){var _0x13ca2=this;return new Promise(function(_0x63b4e1,_0x2332bb){return db[_0x7646('0x18')][_0x7646('0x19')]({'raw':_0x2b038e['options']?_0x2b038e['options'][_0x7646('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b038e[_0x7646('0x1b')]?_0x2b038e[_0x7646('0x1b')][_0x7646('0x1c')]||null:null,'attributes':_0x2b038e['options']?_0x2b038e[_0x7646('0x1b')][_0x7646('0x1d')]||null:null,'limit':_0x2b038e[_0x7646('0x1b')]?_0x2b038e['options'][_0x7646('0x1e')]||null:null,'include':_0x2b038e[_0x7646('0x1b')]?_0x2b038e[_0x7646('0x1b')][_0x7646('0x1f')]?_[_0x7646('0x20')](_0x2b038e['options'][_0x7646('0x1f')],function(_0x400d3e){return{'model':db[_0x400d3e[_0x7646('0x21')]],'as':_0x400d3e['as'],'attributes':_0x400d3e[_0x7646('0x1d')],'include':_0x400d3e[_0x7646('0x1f')]?_[_0x7646('0x20')](_0x400d3e['include'],function(_0x146faf){return{'model':db[_0x146faf[_0x7646('0x21')]],'as':_0x146faf['as'],'attributes':_0x146faf['attributes'],'include':_0x146faf[_0x7646('0x1f')]?_[_0x7646('0x20')](_0x146faf[_0x7646('0x1f')],function(_0x24c2f6){return{'model':db[_0x24c2f6[_0x7646('0x21')]],'as':_0x24c2f6['as'],'attributes':_0x24c2f6[_0x7646('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x202cc3){logger[_0x7646('0xe')]('GetTrunk',_0x2b038e);logger[_0x7646('0x11')](_0x7646('0x17'),_0x2b038e,JSON[_0x7646('0x22')](_0x202cc3));_0x63b4e1(_0x202cc3);})['catch'](function(_0x3c6100){logger['error'](_0x7646('0x17'),_0x3c6100[_0x7646('0x15')],_0x2b038e);_0x2332bb(_0x13ca2[_0x7646('0x13')](0x1f4,_0x3c6100['message']));});});};exports[_0x7646('0x23')]=function(_0x5e0660){var _0x1f2922=this;return new Promise(function(_0x1761b8,_0x5570e0){return db['Trunk'][_0x7646('0x24')]({'raw':_0x5e0660[_0x7646('0x1b')]?_0x5e0660['options'][_0x7646('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e0660[_0x7646('0x1b')]?_0x5e0660[_0x7646('0x1b')][_0x7646('0x1c')]||null:null,'attributes':_0x5e0660['options']?_0x5e0660[_0x7646('0x1b')][_0x7646('0x1d')]||null:null,'include':_0x5e0660[_0x7646('0x1b')]?_0x5e0660[_0x7646('0x1b')][_0x7646('0x1f')]?_[_0x7646('0x20')](_0x5e0660[_0x7646('0x1b')][_0x7646('0x1f')],function(_0x14b4dc){return{'model':db[_0x14b4dc[_0x7646('0x21')]],'as':_0x14b4dc['as'],'attributes':_0x14b4dc[_0x7646('0x1d')],'include':_0x14b4dc[_0x7646('0x1f')]?_[_0x7646('0x20')](_0x14b4dc[_0x7646('0x1f')],function(_0x29b772){return{'model':db[_0x29b772[_0x7646('0x21')]],'as':_0x29b772['as'],'attributes':_0x29b772[_0x7646('0x1d')],'include':_0x29b772[_0x7646('0x1f')]?_[_0x7646('0x20')](_0x29b772[_0x7646('0x1f')],function(_0x35826c){return{'model':db[_0x35826c['model']],'as':_0x35826c['as'],'attributes':_0x35826c[_0x7646('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7646('0xd')](function(_0x3229ef){logger[_0x7646('0xe')](_0x7646('0x23'),_0x5e0660);logger['debug'](_0x7646('0x23'),_0x5e0660,JSON['stringify'](_0x3229ef));_0x1761b8(_0x3229ef);})['catch'](function(_0x5e4f4f){logger[_0x7646('0x13')]('ShowTrunk',_0x5e4f4f['message'],_0x5e0660);_0x5570e0(_0x1f2922[_0x7646('0x13')](0x1f4,_0x5e4f4f[_0x7646('0x15')]));});});};
\ No newline at end of file