Built motion from commit 14588770.|2.5.38
[motion2.git] / server / api / trunk / trunk.rpc.js
index 6cc737a..d70e072 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb68a=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','findAll','options','raw','where','attributes','include','map','model','then','ShowTrunk','Trunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb68a,0xac));var _0xab68=function(_0x45daf0,_0x57883f){_0x45daf0=_0x45daf0-0x0;var _0x21dcbe=_0xb68a[_0x45daf0];return _0x21dcbe;};'use strict';var _=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var moment=require(_0xab68('0x2'));var BPromise=require(_0xab68('0x3'));var rs=require(_0xab68('0x4'));var fs=require('fs');var Redis=require(_0xab68('0x5'));var db=require(_0xab68('0x6'))['db'];var utils=require(_0xab68('0x7'));var logger=require(_0xab68('0x8'))(_0xab68('0x9'));var config=require(_0xab68('0xa'));var jayson=require(_0xab68('0xb'));var client=jayson[_0xab68('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3620ab,_0x1292c4,_0xc9815c){return new BPromise(function(_0x3c2df5,_0x31c948){return client['request'](_0x3620ab,_0xc9815c)['then'](function(_0x26c76a){logger[_0xab68('0xd')](_0xab68('0xe'),_0x1292c4,_0xab68('0xf'));logger[_0xab68('0x10')](_0xab68('0x11'),_0x1292c4,'request\x20sent',JSON[_0xab68('0x12')](_0x26c76a));if(_0x26c76a['error']){if(_0x26c76a[_0xab68('0x13')][_0xab68('0x14')]===0x1f4){logger[_0xab68('0x13')](_0xab68('0xe'),_0x1292c4,_0x26c76a[_0xab68('0x13')]['message']);return _0x31c948(_0x26c76a[_0xab68('0x13')][_0xab68('0x15')]);}logger[_0xab68('0x13')]('Trunk,\x20%s,\x20%s',_0x1292c4,_0x26c76a[_0xab68('0x13')]['message']);return _0x3c2df5(_0x26c76a[_0xab68('0x13')]['message']);}else{logger[_0xab68('0xd')](_0xab68('0xe'),_0x1292c4,_0xab68('0xf'));_0x3c2df5(_0x26c76a[_0xab68('0x16')][_0xab68('0x15')]);}})[_0xab68('0x17')](function(_0x5a9aa7){logger[_0xab68('0x13')]('Trunk,\x20%s,\x20%s',_0x1292c4,_0x5a9aa7);_0x31c948(_0x5a9aa7);});});}exports[_0xab68('0x18')]=function(_0xdf7458){var _0x31f21d=this;return new Promise(function(_0x1c8810,_0x176ed1){return db['Trunk'][_0xab68('0x19')]({'raw':_0xdf7458[_0xab68('0x1a')]?_0xdf7458[_0xab68('0x1a')][_0xab68('0x1b')]===undefined?!![]:![]:!![],'where':_0xdf7458['options']?_0xdf7458['options'][_0xab68('0x1c')]||null:null,'attributes':_0xdf7458[_0xab68('0x1a')]?_0xdf7458[_0xab68('0x1a')][_0xab68('0x1d')]||null:null,'limit':_0xdf7458[_0xab68('0x1a')]?_0xdf7458[_0xab68('0x1a')]['limit']||null:null,'include':_0xdf7458[_0xab68('0x1a')]?_0xdf7458[_0xab68('0x1a')][_0xab68('0x1e')]?_[_0xab68('0x1f')](_0xdf7458[_0xab68('0x1a')]['include'],function(_0x5a8a6f){return{'model':db[_0x5a8a6f[_0xab68('0x20')]],'as':_0x5a8a6f['as'],'attributes':_0x5a8a6f[_0xab68('0x1d')],'include':_0x5a8a6f['include']?_[_0xab68('0x1f')](_0x5a8a6f[_0xab68('0x1e')],function(_0x736118){return{'model':db[_0x736118[_0xab68('0x20')]],'as':_0x736118['as'],'attributes':_0x736118[_0xab68('0x1d')],'include':_0x736118['include']?_[_0xab68('0x1f')](_0x736118[_0xab68('0x1e')],function(_0x139d93){return{'model':db[_0x139d93[_0xab68('0x20')]],'as':_0x139d93['as'],'attributes':_0x139d93['attributes']};}):[]};}):[]};}):[]:[]})[_0xab68('0x21')](function(_0x235ae0){logger[_0xab68('0xd')](_0xab68('0x18'),_0xdf7458);logger[_0xab68('0x10')]('GetTrunk',_0xdf7458,JSON[_0xab68('0x12')](_0x235ae0));_0x1c8810(_0x235ae0);})[_0xab68('0x17')](function(_0x4af83a){logger[_0xab68('0x13')]('GetTrunk',_0x4af83a['message'],_0xdf7458);_0x176ed1(_0x31f21d[_0xab68('0x13')](0x1f4,_0x4af83a[_0xab68('0x15')]));});});};exports[_0xab68('0x22')]=function(_0x120373){var _0x342c46=this;return new Promise(function(_0x15dece,_0x569155){return db[_0xab68('0x23')][_0xab68('0x24')]({'raw':_0x120373[_0xab68('0x1a')]?_0x120373[_0xab68('0x1a')][_0xab68('0x1b')]===undefined?!![]:![]:!![],'where':_0x120373[_0xab68('0x1a')]?_0x120373[_0xab68('0x1a')][_0xab68('0x1c')]||null:null,'attributes':_0x120373[_0xab68('0x1a')]?_0x120373[_0xab68('0x1a')][_0xab68('0x1d')]||null:null,'include':_0x120373[_0xab68('0x1a')]?_0x120373[_0xab68('0x1a')][_0xab68('0x1e')]?_[_0xab68('0x1f')](_0x120373[_0xab68('0x1a')]['include'],function(_0x3708a6){return{'model':db[_0x3708a6['model']],'as':_0x3708a6['as'],'attributes':_0x3708a6[_0xab68('0x1d')],'include':_0x3708a6[_0xab68('0x1e')]?_[_0xab68('0x1f')](_0x3708a6['include'],function(_0x1c8976){return{'model':db[_0x1c8976[_0xab68('0x20')]],'as':_0x1c8976['as'],'attributes':_0x1c8976[_0xab68('0x1d')],'include':_0x1c8976['include']?_[_0xab68('0x1f')](_0x1c8976[_0xab68('0x1e')],function(_0x2f8d14){return{'model':db[_0x2f8d14['model']],'as':_0x2f8d14['as'],'attributes':_0x2f8d14['attributes']};}):[]};}):[]};}):[]:[]})[_0xab68('0x21')](function(_0xaf8980){logger[_0xab68('0xd')]('ShowTrunk',_0x120373);logger[_0xab68('0x10')](_0xab68('0x22'),_0x120373,JSON[_0xab68('0x12')](_0xaf8980));_0x15dece(_0xaf8980);})[_0xab68('0x17')](function(_0x5a896c){logger['error'](_0xab68('0x22'),_0x5a896c[_0xab68('0x15')],_0x120373);_0x569155(_0x342c46[_0xab68('0x13')](0x1f4,_0x5a896c['message']));});});};
\ No newline at end of file
+var _0x6409=['code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','findAll','options','raw','attributes','limit','include','map','model','debug','stringify','ShowTrunk','find','where','then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','error'];(function(_0x5c1cdc,_0x322014){var _0x2e8317=function(_0x2e9dfa){while(--_0x2e9dfa){_0x5c1cdc['push'](_0x5c1cdc['shift']());}};_0x2e8317(++_0x322014);}(_0x6409,0x118));var _0x9640=function(_0x2ec5f0,_0x31735e){_0x2ec5f0=_0x2ec5f0-0x0;var _0x35d96a=_0x6409[_0x2ec5f0];return _0x35d96a;};'use strict';var _=require('lodash');var util=require(_0x9640('0x0'));var moment=require('moment');var BPromise=require(_0x9640('0x1'));var rs=require(_0x9640('0x2'));var fs=require('fs');var Redis=require(_0x9640('0x3'));var db=require(_0x9640('0x4'))['db'];var utils=require(_0x9640('0x5'));var logger=require(_0x9640('0x6'))(_0x9640('0x7'));var config=require(_0x9640('0x8'));var jayson=require(_0x9640('0x9'));var client=jayson[_0x9640('0xa')][_0x9640('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43eab4,_0x267f7b,_0x3a6ed9){return new BPromise(function(_0x4dad4c,_0x221147){return client[_0x9640('0xc')](_0x43eab4,_0x3a6ed9)['then'](function(_0x1c7dae){logger[_0x9640('0xd')]('Trunk,\x20%s,\x20%s',_0x267f7b,_0x9640('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x267f7b,_0x9640('0xe'),JSON['stringify'](_0x1c7dae));if(_0x1c7dae[_0x9640('0xf')]){if(_0x1c7dae[_0x9640('0xf')][_0x9640('0x10')]===0x1f4){logger[_0x9640('0xf')]('Trunk,\x20%s,\x20%s',_0x267f7b,_0x1c7dae[_0x9640('0xf')][_0x9640('0x11')]);return _0x221147(_0x1c7dae[_0x9640('0xf')]['message']);}logger[_0x9640('0xf')](_0x9640('0x12'),_0x267f7b,_0x1c7dae[_0x9640('0xf')]['message']);return _0x4dad4c(_0x1c7dae['error']['message']);}else{logger[_0x9640('0xd')](_0x9640('0x12'),_0x267f7b,_0x9640('0xe'));_0x4dad4c(_0x1c7dae[_0x9640('0x13')][_0x9640('0x11')]);}})[_0x9640('0x14')](function(_0x1bd2cb){logger[_0x9640('0xf')](_0x9640('0x12'),_0x267f7b,_0x1bd2cb);_0x221147(_0x1bd2cb);});});}exports[_0x9640('0x15')]=function(_0x3f832f){var _0x32e5ee=this;return new Promise(function(_0x45de61,_0x250f9e){return db[_0x9640('0x16')][_0x9640('0x17')]({'raw':_0x3f832f['options']?_0x3f832f[_0x9640('0x18')][_0x9640('0x19')]===undefined?!![]:![]:!![],'where':_0x3f832f[_0x9640('0x18')]?_0x3f832f[_0x9640('0x18')]['where']||null:null,'attributes':_0x3f832f[_0x9640('0x18')]?_0x3f832f[_0x9640('0x18')][_0x9640('0x1a')]||null:null,'limit':_0x3f832f[_0x9640('0x18')]?_0x3f832f[_0x9640('0x18')][_0x9640('0x1b')]||null:null,'include':_0x3f832f[_0x9640('0x18')]?_0x3f832f[_0x9640('0x18')][_0x9640('0x1c')]?_[_0x9640('0x1d')](_0x3f832f[_0x9640('0x18')]['include'],function(_0x24545f){return{'model':db[_0x24545f[_0x9640('0x1e')]],'as':_0x24545f['as'],'attributes':_0x24545f[_0x9640('0x1a')],'include':_0x24545f[_0x9640('0x1c')]?_[_0x9640('0x1d')](_0x24545f[_0x9640('0x1c')],function(_0x3896fb){return{'model':db[_0x3896fb[_0x9640('0x1e')]],'as':_0x3896fb['as'],'attributes':_0x3896fb['attributes'],'include':_0x3896fb[_0x9640('0x1c')]?_['map'](_0x3896fb[_0x9640('0x1c')],function(_0x2ee058){return{'model':db[_0x2ee058['model']],'as':_0x2ee058['as'],'attributes':_0x2ee058[_0x9640('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47336a){logger[_0x9640('0xd')]('GetTrunk',_0x3f832f);logger[_0x9640('0x1f')](_0x9640('0x15'),_0x3f832f,JSON[_0x9640('0x20')](_0x47336a));_0x45de61(_0x47336a);})[_0x9640('0x14')](function(_0x5c64d5){logger['error'](_0x9640('0x15'),_0x5c64d5[_0x9640('0x11')],_0x3f832f);_0x250f9e(_0x32e5ee[_0x9640('0xf')](0x1f4,_0x5c64d5[_0x9640('0x11')]));});});};exports[_0x9640('0x21')]=function(_0x1bf339){var _0x137d89=this;return new Promise(function(_0x3a377e,_0xcf5662){return db[_0x9640('0x16')][_0x9640('0x22')]({'raw':_0x1bf339[_0x9640('0x18')]?_0x1bf339[_0x9640('0x18')][_0x9640('0x19')]===undefined?!![]:![]:!![],'where':_0x1bf339[_0x9640('0x18')]?_0x1bf339[_0x9640('0x18')][_0x9640('0x23')]||null:null,'attributes':_0x1bf339['options']?_0x1bf339[_0x9640('0x18')][_0x9640('0x1a')]||null:null,'include':_0x1bf339[_0x9640('0x18')]?_0x1bf339['options'][_0x9640('0x1c')]?_[_0x9640('0x1d')](_0x1bf339[_0x9640('0x18')][_0x9640('0x1c')],function(_0x4a67ca){return{'model':db[_0x4a67ca[_0x9640('0x1e')]],'as':_0x4a67ca['as'],'attributes':_0x4a67ca[_0x9640('0x1a')],'include':_0x4a67ca['include']?_[_0x9640('0x1d')](_0x4a67ca[_0x9640('0x1c')],function(_0x4c6c40){return{'model':db[_0x4c6c40['model']],'as':_0x4c6c40['as'],'attributes':_0x4c6c40['attributes'],'include':_0x4c6c40[_0x9640('0x1c')]?_[_0x9640('0x1d')](_0x4c6c40[_0x9640('0x1c')],function(_0x194608){return{'model':db[_0x194608[_0x9640('0x1e')]],'as':_0x194608['as'],'attributes':_0x194608[_0x9640('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9640('0x24')](function(_0x2d3714){logger[_0x9640('0xd')]('ShowTrunk',_0x1bf339);logger[_0x9640('0x1f')](_0x9640('0x21'),_0x1bf339,JSON[_0x9640('0x20')](_0x2d3714));_0x3a377e(_0x2d3714);})['catch'](function(_0x7d97ee){logger[_0x9640('0xf')](_0x9640('0x21'),_0x7d97ee[_0x9640('0x11')],_0x1bf339);_0xcf5662(_0x137d89['error'](0x1f4,_0x7d97ee[_0x9640('0x11')]));});});};
\ No newline at end of file