Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / api / trunk / trunk.rpc.js
index bca5fdb..16359c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ed2=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','model','map','ShowTrunk','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x38dd06,_0x3edf66){var _0x3c6312=function(_0x3491cc){while(--_0x3491cc){_0x38dd06['push'](_0x38dd06['shift']());}};_0x3c6312(++_0x3edf66);}(_0x7ed2,0x1ed));var _0x27ed=function(_0x575c02,_0x18e3ce){_0x575c02=_0x575c02-0x0;var _0x1d9fdc=_0x7ed2[_0x575c02];return _0x1d9fdc;};'use strict';var _=require(_0x27ed('0x0'));var util=require(_0x27ed('0x1'));var moment=require('moment');var BPromise=require(_0x27ed('0x2'));var rs=require(_0x27ed('0x3'));var fs=require('fs');var Redis=require(_0x27ed('0x4'));var db=require(_0x27ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x27ed('0x6'))(_0x27ed('0x7'));var config=require(_0x27ed('0x8'));var jayson=require(_0x27ed('0x9'));var client=jayson[_0x27ed('0xa')][_0x27ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32fb45,_0x3a03e2,_0x41e603){return new BPromise(function(_0x220dcb,_0x125187){return client['request'](_0x32fb45,_0x41e603)[_0x27ed('0xc')](function(_0x15ecb9){logger[_0x27ed('0xd')](_0x27ed('0xe'),_0x3a03e2,_0x27ed('0xf'));logger[_0x27ed('0x10')](_0x27ed('0x11'),_0x3a03e2,_0x27ed('0xf'),JSON[_0x27ed('0x12')](_0x15ecb9));if(_0x15ecb9[_0x27ed('0x13')]){if(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x14')]===0x1f4){logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);return _0x125187(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);}logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x15ecb9[_0x27ed('0x13')]['message']);return _0x220dcb(_0x15ecb9[_0x27ed('0x13')][_0x27ed('0x15')]);}else{logger[_0x27ed('0xd')]('Trunk,\x20%s,\x20%s',_0x3a03e2,_0x27ed('0xf'));_0x220dcb(_0x15ecb9['result']['message']);}})[_0x27ed('0x16')](function(_0x4cdb7b){logger[_0x27ed('0x13')](_0x27ed('0xe'),_0x3a03e2,_0x4cdb7b);_0x125187(_0x4cdb7b);});});}exports[_0x27ed('0x17')]=function(_0x3ab3b6){var _0x2629f8=this;return new Promise(function(_0x23a830,_0x15bfe9){return db[_0x27ed('0x18')]['findAll']({'raw':_0x3ab3b6[_0x27ed('0x19')]?_0x3ab3b6[_0x27ed('0x19')][_0x27ed('0x1a')]===undefined?!![]:![]:!![],'where':_0x3ab3b6[_0x27ed('0x19')]?_0x3ab3b6[_0x27ed('0x19')][_0x27ed('0x1b')]||null:null,'attributes':_0x3ab3b6[_0x27ed('0x19')]?_0x3ab3b6['options'][_0x27ed('0x1c')]||null:null,'limit':_0x3ab3b6[_0x27ed('0x19')]?_0x3ab3b6['options'][_0x27ed('0x1d')]||null:null,'include':_0x3ab3b6[_0x27ed('0x19')]?_0x3ab3b6[_0x27ed('0x19')][_0x27ed('0x1e')]?_['map'](_0x3ab3b6['options'][_0x27ed('0x1e')],function(_0x238883){return{'model':db[_0x238883[_0x27ed('0x1f')]],'as':_0x238883['as'],'attributes':_0x238883['attributes'],'include':_0x238883[_0x27ed('0x1e')]?_[_0x27ed('0x20')](_0x238883[_0x27ed('0x1e')],function(_0x58757b){return{'model':db[_0x58757b[_0x27ed('0x1f')]],'as':_0x58757b['as'],'attributes':_0x58757b[_0x27ed('0x1c')],'include':_0x58757b[_0x27ed('0x1e')]?_['map'](_0x58757b['include'],function(_0x379b14){return{'model':db[_0x379b14['model']],'as':_0x379b14['as'],'attributes':_0x379b14[_0x27ed('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x876c47){logger[_0x27ed('0xd')](_0x27ed('0x17'),_0x3ab3b6);logger[_0x27ed('0x10')](_0x27ed('0x17'),_0x3ab3b6,JSON[_0x27ed('0x12')](_0x876c47));_0x23a830(_0x876c47);})[_0x27ed('0x16')](function(_0x2646f8){logger[_0x27ed('0x13')](_0x27ed('0x17'),_0x2646f8[_0x27ed('0x15')],_0x3ab3b6);_0x15bfe9(_0x2629f8[_0x27ed('0x13')](0x1f4,_0x2646f8[_0x27ed('0x15')]));});});};exports[_0x27ed('0x21')]=function(_0x53564a){var _0x5b2cd2=this;return new Promise(function(_0x29fcaa,_0x357902){return db[_0x27ed('0x18')]['find']({'raw':_0x53564a['options']?_0x53564a[_0x27ed('0x19')][_0x27ed('0x1a')]===undefined?!![]:![]:!![],'where':_0x53564a[_0x27ed('0x19')]?_0x53564a[_0x27ed('0x19')][_0x27ed('0x1b')]||null:null,'attributes':_0x53564a[_0x27ed('0x19')]?_0x53564a[_0x27ed('0x19')][_0x27ed('0x1c')]||null:null,'include':_0x53564a[_0x27ed('0x19')]?_0x53564a['options'][_0x27ed('0x1e')]?_[_0x27ed('0x20')](_0x53564a['options'][_0x27ed('0x1e')],function(_0x2b31ba){return{'model':db[_0x2b31ba['model']],'as':_0x2b31ba['as'],'attributes':_0x2b31ba[_0x27ed('0x1c')],'include':_0x2b31ba[_0x27ed('0x1e')]?_[_0x27ed('0x20')](_0x2b31ba['include'],function(_0x3163c0){return{'model':db[_0x3163c0['model']],'as':_0x3163c0['as'],'attributes':_0x3163c0[_0x27ed('0x1c')],'include':_0x3163c0['include']?_[_0x27ed('0x20')](_0x3163c0[_0x27ed('0x1e')],function(_0x191fc2){return{'model':db[_0x191fc2[_0x27ed('0x1f')]],'as':_0x191fc2['as'],'attributes':_0x191fc2[_0x27ed('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x27ed('0xc')](function(_0x4cec45){logger[_0x27ed('0xd')](_0x27ed('0x21'),_0x53564a);logger['debug'](_0x27ed('0x21'),_0x53564a,JSON[_0x27ed('0x12')](_0x4cec45));_0x29fcaa(_0x4cec45);})[_0x27ed('0x16')](function(_0x276570){logger[_0x27ed('0x13')]('ShowTrunk',_0x276570[_0x27ed('0x15')],_0x53564a);_0x357902(_0x5b2cd2['error'](0x1f4,_0x276570[_0x27ed('0x15')]));});});};
\ No newline at end of file
+var _0x0a9f=['catch','GetTrunk','Trunk','findAll','options','raw','where','limit','model','attributes','include','map','then','debug','stringify','ShowTrunk','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a9f,0x19d));var _0xf0a9=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x0a9f[_0xa45395];return _0x3c83d2;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var moment=require('moment');var BPromise=require(_0xf0a9('0x2'));var rs=require(_0xf0a9('0x3'));var fs=require('fs');var Redis=require(_0xf0a9('0x4'));var db=require(_0xf0a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0a9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf0a9('0x7'));var client=jayson[_0xf0a9('0x8')][_0xf0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e71c4,_0x36396c,_0xd1e58d){return new BPromise(function(_0x9852f8,_0x2d1794){return client[_0xf0a9('0xa')](_0x2e71c4,_0xd1e58d)['then'](function(_0x20648d){logger[_0xf0a9('0xb')](_0xf0a9('0xc'),_0x36396c,_0xf0a9('0xd'));logger['debug'](_0xf0a9('0xe'),_0x36396c,_0xf0a9('0xd'),JSON['stringify'](_0x20648d));if(_0x20648d[_0xf0a9('0xf')]){if(_0x20648d[_0xf0a9('0xf')][_0xf0a9('0x10')]===0x1f4){logger[_0xf0a9('0xf')]('Trunk,\x20%s,\x20%s',_0x36396c,_0x20648d['error'][_0xf0a9('0x11')]);return _0x2d1794(_0x20648d['error'][_0xf0a9('0x11')]);}logger['error'](_0xf0a9('0xc'),_0x36396c,_0x20648d[_0xf0a9('0xf')]['message']);return _0x9852f8(_0x20648d[_0xf0a9('0xf')][_0xf0a9('0x11')]);}else{logger[_0xf0a9('0xb')](_0xf0a9('0xc'),_0x36396c,_0xf0a9('0xd'));_0x9852f8(_0x20648d[_0xf0a9('0x12')]['message']);}})[_0xf0a9('0x13')](function(_0x5c5fb6){logger[_0xf0a9('0xf')](_0xf0a9('0xc'),_0x36396c,_0x5c5fb6);_0x2d1794(_0x5c5fb6);});});}exports[_0xf0a9('0x14')]=function(_0x2b2d4a){var _0x4609e4=this;return new Promise(function(_0x516f23,_0x556fb9){return db[_0xf0a9('0x15')][_0xf0a9('0x16')]({'raw':_0x2b2d4a[_0xf0a9('0x17')]?_0x2b2d4a['options'][_0xf0a9('0x18')]===undefined?!![]:![]:!![],'where':_0x2b2d4a[_0xf0a9('0x17')]?_0x2b2d4a[_0xf0a9('0x17')][_0xf0a9('0x19')]||null:null,'attributes':_0x2b2d4a[_0xf0a9('0x17')]?_0x2b2d4a[_0xf0a9('0x17')]['attributes']||null:null,'limit':_0x2b2d4a['options']?_0x2b2d4a['options'][_0xf0a9('0x1a')]||null:null,'include':_0x2b2d4a[_0xf0a9('0x17')]?_0x2b2d4a[_0xf0a9('0x17')]['include']?_['map'](_0x2b2d4a[_0xf0a9('0x17')]['include'],function(_0x2d7d36){return{'model':db[_0x2d7d36[_0xf0a9('0x1b')]],'as':_0x2d7d36['as'],'attributes':_0x2d7d36[_0xf0a9('0x1c')],'include':_0x2d7d36[_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x2d7d36[_0xf0a9('0x1d')],function(_0x4b6163){return{'model':db[_0x4b6163[_0xf0a9('0x1b')]],'as':_0x4b6163['as'],'attributes':_0x4b6163[_0xf0a9('0x1c')],'include':_0x4b6163['include']?_[_0xf0a9('0x1e')](_0x4b6163[_0xf0a9('0x1d')],function(_0x4cbef1){return{'model':db[_0x4cbef1[_0xf0a9('0x1b')]],'as':_0x4cbef1['as'],'attributes':_0x4cbef1[_0xf0a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf0a9('0x1f')](function(_0x2e5acd){logger['info']('GetTrunk',_0x2b2d4a);logger[_0xf0a9('0x20')](_0xf0a9('0x14'),_0x2b2d4a,JSON[_0xf0a9('0x21')](_0x2e5acd));_0x516f23(_0x2e5acd);})[_0xf0a9('0x13')](function(_0x5e1ffd){logger[_0xf0a9('0xf')](_0xf0a9('0x14'),_0x5e1ffd[_0xf0a9('0x11')],_0x2b2d4a);_0x556fb9(_0x4609e4[_0xf0a9('0xf')](0x1f4,_0x5e1ffd[_0xf0a9('0x11')]));});});};exports[_0xf0a9('0x22')]=function(_0x126be3){var _0x4296f7=this;return new Promise(function(_0xd10bd4,_0x27fa4d){return db[_0xf0a9('0x15')][_0xf0a9('0x23')]({'raw':_0x126be3['options']?_0x126be3['options'][_0xf0a9('0x18')]===undefined?!![]:![]:!![],'where':_0x126be3[_0xf0a9('0x17')]?_0x126be3[_0xf0a9('0x17')][_0xf0a9('0x19')]||null:null,'attributes':_0x126be3[_0xf0a9('0x17')]?_0x126be3['options']['attributes']||null:null,'include':_0x126be3['options']?_0x126be3[_0xf0a9('0x17')][_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x126be3[_0xf0a9('0x17')][_0xf0a9('0x1d')],function(_0x59b24a){return{'model':db[_0x59b24a[_0xf0a9('0x1b')]],'as':_0x59b24a['as'],'attributes':_0x59b24a['attributes'],'include':_0x59b24a[_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x59b24a[_0xf0a9('0x1d')],function(_0x48996a){return{'model':db[_0x48996a['model']],'as':_0x48996a['as'],'attributes':_0x48996a[_0xf0a9('0x1c')],'include':_0x48996a[_0xf0a9('0x1d')]?_[_0xf0a9('0x1e')](_0x48996a[_0xf0a9('0x1d')],function(_0x5c16ca){return{'model':db[_0x5c16ca['model']],'as':_0x5c16ca['as'],'attributes':_0x5c16ca[_0xf0a9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf0a9('0x1f')](function(_0x21cc38){logger[_0xf0a9('0xb')](_0xf0a9('0x22'),_0x126be3);logger[_0xf0a9('0x20')]('ShowTrunk',_0x126be3,JSON[_0xf0a9('0x21')](_0x21cc38));_0xd10bd4(_0x21cc38);})[_0xf0a9('0x13')](function(_0x27eab3){logger[_0xf0a9('0xf')](_0xf0a9('0x22'),_0x27eab3[_0xf0a9('0x11')],_0x126be3);_0x27fa4d(_0x4296f7[_0xf0a9('0xf')](0x1f4,_0x27eab3[_0xf0a9('0x11')]));});});};
\ No newline at end of file