Built motion from commit 1ea47bf4.|2.6.34
[motion2.git] / server / api / trunk / trunk.rpc.js
index 9d4a398..abfe128 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf774=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','ShowTrunk','lodash'];(function(_0x8ef800,_0x270234){var _0x3386f6=function(_0x141f30){while(--_0x141f30){_0x8ef800['push'](_0x8ef800['shift']());}};_0x3386f6(++_0x270234);}(_0xf774,0xae));var _0x4f77=function(_0xcaf098,_0x9f56c5){_0xcaf098=_0xcaf098-0x0;var _0x7cc5b4=_0xf774[_0xcaf098];return _0x7cc5b4;};'use strict';var _=require(_0x4f77('0x0'));var util=require('util');var moment=require(_0x4f77('0x1'));var BPromise=require(_0x4f77('0x2'));var rs=require(_0x4f77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f77('0x4'))['db'];var utils=require(_0x4f77('0x5'));var logger=require(_0x4f77('0x6'))(_0x4f77('0x7'));var config=require(_0x4f77('0x8'));var jayson=require(_0x4f77('0x9'));var client=jayson[_0x4f77('0xa')][_0x4f77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e180,_0x4daa2a,_0x452882){return new BPromise(function(_0x12e994,_0xdb92c5){return client[_0x4f77('0xc')](_0x12e180,_0x452882)[_0x4f77('0xd')](function(_0x4706d8){logger[_0x4f77('0xe')](_0x4f77('0xf'),_0x4daa2a,'request\x20sent');logger[_0x4f77('0x10')](_0x4f77('0x11'),_0x4daa2a,'request\x20sent',JSON[_0x4f77('0x12')](_0x4706d8));if(_0x4706d8[_0x4f77('0x13')]){if(_0x4706d8['error'][_0x4f77('0x14')]===0x1f4){logger[_0x4f77('0x13')]('Trunk,\x20%s,\x20%s',_0x4daa2a,_0x4706d8['error'][_0x4f77('0x15')]);return _0xdb92c5(_0x4706d8[_0x4f77('0x13')][_0x4f77('0x15')]);}logger[_0x4f77('0x13')](_0x4f77('0xf'),_0x4daa2a,_0x4706d8[_0x4f77('0x13')][_0x4f77('0x15')]);return _0x12e994(_0x4706d8['error'][_0x4f77('0x15')]);}else{logger[_0x4f77('0xe')](_0x4f77('0xf'),_0x4daa2a,_0x4f77('0x16'));_0x12e994(_0x4706d8['result'][_0x4f77('0x15')]);}})[_0x4f77('0x17')](function(_0xf3e2a){logger[_0x4f77('0x13')](_0x4f77('0xf'),_0x4daa2a,_0xf3e2a);_0xdb92c5(_0xf3e2a);});});}exports[_0x4f77('0x18')]=function(_0x5e0689){var _0x22cc59=this;return new Promise(function(_0x45f2b6,_0x4b19fe){return db[_0x4f77('0x19')][_0x4f77('0x1a')]({'raw':_0x5e0689['options']?_0x5e0689[_0x4f77('0x1b')][_0x4f77('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e0689[_0x4f77('0x1b')]?_0x5e0689['options'][_0x4f77('0x1d')]||null:null,'attributes':_0x5e0689[_0x4f77('0x1b')]?_0x5e0689[_0x4f77('0x1b')][_0x4f77('0x1e')]||null:null,'limit':_0x5e0689[_0x4f77('0x1b')]?_0x5e0689[_0x4f77('0x1b')]['limit']||null:null,'include':_0x5e0689[_0x4f77('0x1b')]?_0x5e0689[_0x4f77('0x1b')][_0x4f77('0x1f')]?_['map'](_0x5e0689[_0x4f77('0x1b')][_0x4f77('0x1f')],function(_0x2a803c){return{'model':db[_0x2a803c[_0x4f77('0x20')]],'as':_0x2a803c['as'],'attributes':_0x2a803c['attributes'],'include':_0x2a803c['include']?_[_0x4f77('0x21')](_0x2a803c[_0x4f77('0x1f')],function(_0x2056e2){return{'model':db[_0x2056e2[_0x4f77('0x20')]],'as':_0x2056e2['as'],'attributes':_0x2056e2[_0x4f77('0x1e')],'include':_0x2056e2[_0x4f77('0x1f')]?_[_0x4f77('0x21')](_0x2056e2[_0x4f77('0x1f')],function(_0x237e2e){return{'model':db[_0x237e2e[_0x4f77('0x20')]],'as':_0x237e2e['as'],'attributes':_0x237e2e[_0x4f77('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4f77('0xd')](function(_0x3e5f8d){logger[_0x4f77('0xe')]('GetTrunk',_0x5e0689);logger[_0x4f77('0x10')](_0x4f77('0x18'),_0x5e0689,JSON[_0x4f77('0x12')](_0x3e5f8d));_0x45f2b6(_0x3e5f8d);})[_0x4f77('0x17')](function(_0x4528fe){logger[_0x4f77('0x13')](_0x4f77('0x18'),_0x4528fe[_0x4f77('0x15')],_0x5e0689);_0x4b19fe(_0x22cc59[_0x4f77('0x13')](0x1f4,_0x4528fe[_0x4f77('0x15')]));});});};exports[_0x4f77('0x22')]=function(_0x4b3687){var _0x22d28a=this;return new Promise(function(_0x1ff18b,_0x47ea06){return db['Trunk']['find']({'raw':_0x4b3687[_0x4f77('0x1b')]?_0x4b3687[_0x4f77('0x1b')][_0x4f77('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b3687[_0x4f77('0x1b')]?_0x4b3687[_0x4f77('0x1b')][_0x4f77('0x1d')]||null:null,'attributes':_0x4b3687[_0x4f77('0x1b')]?_0x4b3687[_0x4f77('0x1b')]['attributes']||null:null,'include':_0x4b3687[_0x4f77('0x1b')]?_0x4b3687['options']['include']?_[_0x4f77('0x21')](_0x4b3687[_0x4f77('0x1b')][_0x4f77('0x1f')],function(_0x191299){return{'model':db[_0x191299[_0x4f77('0x20')]],'as':_0x191299['as'],'attributes':_0x191299['attributes'],'include':_0x191299['include']?_[_0x4f77('0x21')](_0x191299[_0x4f77('0x1f')],function(_0x8631f4){return{'model':db[_0x8631f4['model']],'as':_0x8631f4['as'],'attributes':_0x8631f4[_0x4f77('0x1e')],'include':_0x8631f4[_0x4f77('0x1f')]?_[_0x4f77('0x21')](_0x8631f4['include'],function(_0x291221){return{'model':db[_0x291221[_0x4f77('0x20')]],'as':_0x291221['as'],'attributes':_0x291221[_0x4f77('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4f77('0xd')](function(_0x1b6021){logger[_0x4f77('0xe')]('ShowTrunk',_0x4b3687);logger[_0x4f77('0x10')]('ShowTrunk',_0x4b3687,JSON[_0x4f77('0x12')](_0x1b6021));_0x1ff18b(_0x1b6021);})[_0x4f77('0x17')](function(_0x31dc14){logger[_0x4f77('0x13')](_0x4f77('0x22'),_0x31dc14[_0x4f77('0x15')],_0x4b3687);_0x47ea06(_0x22d28a[_0x4f77('0x13')](0x1f4,_0x31dc14['message']));});});};
\ No newline at end of file
+var _0xc6c9=['stringify','catch','ShowTrunk','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Trunk,\x20%s,\x20%s','result','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','GetTrunk'];(function(_0x22789a,_0x4a1c8c){var _0xede88=function(_0x49243f){while(--_0x49243f){_0x22789a['push'](_0x22789a['shift']());}};_0xede88(++_0x4a1c8c);}(_0xc6c9,0x76));var _0x9c6c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc6c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9c6c('0x0'));var util=require('util');var moment=require(_0x9c6c('0x1'));var BPromise=require(_0x9c6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c6c('0x3'));var db=require(_0x9c6c('0x4'))['db'];var utils=require(_0x9c6c('0x5'));var logger=require(_0x9c6c('0x6'))(_0x9c6c('0x7'));var config=require(_0x9c6c('0x8'));var jayson=require(_0x9c6c('0x9'));var client=jayson[_0x9c6c('0xa')][_0x9c6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8a77,_0x1e7f03,_0x262fdf){return new BPromise(function(_0x5481ac,_0x1f0e2e){return client[_0x9c6c('0xc')](_0x3b8a77,_0x262fdf)[_0x9c6c('0xd')](function(_0xd61bc9){logger[_0x9c6c('0xe')]('Trunk,\x20%s,\x20%s',_0x1e7f03,'request\x20sent');logger[_0x9c6c('0xf')](_0x9c6c('0x10'),_0x1e7f03,_0x9c6c('0x11'),JSON['stringify'](_0xd61bc9));if(_0xd61bc9[_0x9c6c('0x12')]){if(_0xd61bc9[_0x9c6c('0x12')][_0x9c6c('0x13')]===0x1f4){logger[_0x9c6c('0x12')]('Trunk,\x20%s,\x20%s',_0x1e7f03,_0xd61bc9[_0x9c6c('0x12')][_0x9c6c('0x14')]);return _0x1f0e2e(_0xd61bc9[_0x9c6c('0x12')][_0x9c6c('0x14')]);}logger[_0x9c6c('0x12')]('Trunk,\x20%s,\x20%s',_0x1e7f03,_0xd61bc9[_0x9c6c('0x12')][_0x9c6c('0x14')]);return _0x5481ac(_0xd61bc9[_0x9c6c('0x12')][_0x9c6c('0x14')]);}else{logger['info'](_0x9c6c('0x15'),_0x1e7f03,_0x9c6c('0x11'));_0x5481ac(_0xd61bc9[_0x9c6c('0x16')][_0x9c6c('0x14')]);}})['catch'](function(_0xda51fc){logger['error']('Trunk,\x20%s,\x20%s',_0x1e7f03,_0xda51fc);_0x1f0e2e(_0xda51fc);});});}exports['GetTrunk']=function(_0x3b6e59){var _0x5716b0=this;return new Promise(function(_0x8beeb5,_0x5d1f94){return db[_0x9c6c('0x17')][_0x9c6c('0x18')]({'raw':_0x3b6e59[_0x9c6c('0x19')]?_0x3b6e59[_0x9c6c('0x19')][_0x9c6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b6e59[_0x9c6c('0x19')]?_0x3b6e59[_0x9c6c('0x19')][_0x9c6c('0x1b')]||null:null,'attributes':_0x3b6e59[_0x9c6c('0x19')]?_0x3b6e59[_0x9c6c('0x19')][_0x9c6c('0x1c')]||null:null,'limit':_0x3b6e59[_0x9c6c('0x19')]?_0x3b6e59['options'][_0x9c6c('0x1d')]||null:null,'include':_0x3b6e59[_0x9c6c('0x19')]?_0x3b6e59[_0x9c6c('0x19')][_0x9c6c('0x1e')]?_[_0x9c6c('0x1f')](_0x3b6e59[_0x9c6c('0x19')]['include'],function(_0x20bb4c){return{'model':db[_0x20bb4c[_0x9c6c('0x20')]],'as':_0x20bb4c['as'],'attributes':_0x20bb4c[_0x9c6c('0x1c')],'include':_0x20bb4c[_0x9c6c('0x1e')]?_[_0x9c6c('0x1f')](_0x20bb4c['include'],function(_0x6db7d5){return{'model':db[_0x6db7d5[_0x9c6c('0x20')]],'as':_0x6db7d5['as'],'attributes':_0x6db7d5[_0x9c6c('0x1c')],'include':_0x6db7d5[_0x9c6c('0x1e')]?_['map'](_0x6db7d5['include'],function(_0xba8d83){return{'model':db[_0xba8d83[_0x9c6c('0x20')]],'as':_0xba8d83['as'],'attributes':_0xba8d83[_0x9c6c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x180e7c){logger[_0x9c6c('0xe')](_0x9c6c('0x21'),_0x3b6e59);logger[_0x9c6c('0xf')]('GetTrunk',_0x3b6e59,JSON[_0x9c6c('0x22')](_0x180e7c));_0x8beeb5(_0x180e7c);})[_0x9c6c('0x23')](function(_0x206beb){logger[_0x9c6c('0x12')](_0x9c6c('0x21'),_0x206beb['message'],_0x3b6e59);_0x5d1f94(_0x5716b0['error'](0x1f4,_0x206beb[_0x9c6c('0x14')]));});});};exports[_0x9c6c('0x24')]=function(_0x31e77a){var _0x292777=this;return new Promise(function(_0x295896,_0x3f1680){return db[_0x9c6c('0x17')][_0x9c6c('0x25')]({'raw':_0x31e77a[_0x9c6c('0x19')]?_0x31e77a[_0x9c6c('0x19')][_0x9c6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x31e77a[_0x9c6c('0x19')]?_0x31e77a[_0x9c6c('0x19')][_0x9c6c('0x1b')]||null:null,'attributes':_0x31e77a['options']?_0x31e77a[_0x9c6c('0x19')]['attributes']||null:null,'include':_0x31e77a[_0x9c6c('0x19')]?_0x31e77a['options'][_0x9c6c('0x1e')]?_[_0x9c6c('0x1f')](_0x31e77a[_0x9c6c('0x19')][_0x9c6c('0x1e')],function(_0x21c732){return{'model':db[_0x21c732[_0x9c6c('0x20')]],'as':_0x21c732['as'],'attributes':_0x21c732[_0x9c6c('0x1c')],'include':_0x21c732[_0x9c6c('0x1e')]?_[_0x9c6c('0x1f')](_0x21c732[_0x9c6c('0x1e')],function(_0x9afbe1){return{'model':db[_0x9afbe1['model']],'as':_0x9afbe1['as'],'attributes':_0x9afbe1['attributes'],'include':_0x9afbe1[_0x9c6c('0x1e')]?_[_0x9c6c('0x1f')](_0x9afbe1[_0x9c6c('0x1e')],function(_0x129e1e){return{'model':db[_0x129e1e[_0x9c6c('0x20')]],'as':_0x129e1e['as'],'attributes':_0x129e1e[_0x9c6c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b2f67){logger[_0x9c6c('0xe')]('ShowTrunk',_0x31e77a);logger[_0x9c6c('0xf')]('ShowTrunk',_0x31e77a,JSON['stringify'](_0x3b2f67));_0x295896(_0x3b2f67);})[_0x9c6c('0x23')](function(_0x10cb8f){logger[_0x9c6c('0x12')]('ShowTrunk',_0x10cb8f[_0x9c6c('0x14')],_0x31e77a);_0x3f1680(_0x292777[_0x9c6c('0x12')](0x1f4,_0x10cb8f[_0x9c6c('0x14')]));});});};
\ No newline at end of file