Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / trunk / trunk.rpc.js
index cc922cc..b031ae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff26=['model','find','where','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetTrunk','findAll','options','attributes','limit','include','map'];(function(_0x1e9d6a,_0x3e5cab){var _0x222bd1=function(_0x3e9c8f){while(--_0x3e9c8f){_0x1e9d6a['push'](_0x1e9d6a['shift']());}};_0x222bd1(++_0x3e5cab);}(_0xff26,0x1b6));var _0x6ff2=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0xff26[_0x174202];return _0x4daa4a;};'use strict';var _=require('lodash');var util=require(_0x6ff2('0x0'));var moment=require(_0x6ff2('0x1'));var BPromise=require(_0x6ff2('0x2'));var rs=require(_0x6ff2('0x3'));var fs=require('fs');var Redis=require(_0x6ff2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ff2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ff2('0x6')][_0x6ff2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5a8b5b,_0x4b1765,_0x1ae8c9){return new BPromise(function(_0x4a3f09,_0x1118e0){return client['request'](_0x5a8b5b,_0x1ae8c9)[_0x6ff2('0x8')](function(_0x26ff82){logger[_0x6ff2('0x9')](_0x6ff2('0xa'),_0x4b1765,_0x6ff2('0xb'));logger[_0x6ff2('0xc')](_0x6ff2('0xd'),_0x4b1765,_0x6ff2('0xb'),JSON[_0x6ff2('0xe')](_0x26ff82));if(_0x26ff82['error']){if(_0x26ff82['error'][_0x6ff2('0xf')]===0x1f4){logger[_0x6ff2('0x10')]('Trunk,\x20%s,\x20%s',_0x4b1765,_0x26ff82[_0x6ff2('0x10')][_0x6ff2('0x11')]);return _0x1118e0(_0x26ff82[_0x6ff2('0x10')]['message']);}logger[_0x6ff2('0x10')](_0x6ff2('0xa'),_0x4b1765,_0x26ff82[_0x6ff2('0x10')][_0x6ff2('0x11')]);return _0x4a3f09(_0x26ff82[_0x6ff2('0x10')][_0x6ff2('0x11')]);}else{logger['info'](_0x6ff2('0xa'),_0x4b1765,_0x6ff2('0xb'));_0x4a3f09(_0x26ff82[_0x6ff2('0x12')][_0x6ff2('0x11')]);}})[_0x6ff2('0x13')](function(_0x3d0049){logger[_0x6ff2('0x10')](_0x6ff2('0xa'),_0x4b1765,_0x3d0049);_0x1118e0(_0x3d0049);});});}exports[_0x6ff2('0x14')]=function(_0x50a9d8){var _0x585be5=this;return new Promise(function(_0x53377e,_0x5267b0){return db['Trunk'][_0x6ff2('0x15')]({'raw':_0x50a9d8[_0x6ff2('0x16')]?_0x50a9d8[_0x6ff2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x50a9d8[_0x6ff2('0x16')]?_0x50a9d8['options']['where']||null:null,'attributes':_0x50a9d8[_0x6ff2('0x16')]?_0x50a9d8[_0x6ff2('0x16')][_0x6ff2('0x17')]||null:null,'limit':_0x50a9d8[_0x6ff2('0x16')]?_0x50a9d8[_0x6ff2('0x16')][_0x6ff2('0x18')]||null:null,'include':_0x50a9d8[_0x6ff2('0x16')]?_0x50a9d8[_0x6ff2('0x16')][_0x6ff2('0x19')]?_[_0x6ff2('0x1a')](_0x50a9d8[_0x6ff2('0x16')][_0x6ff2('0x19')],function(_0x2ce554){return{'model':db[_0x2ce554['model']],'as':_0x2ce554['as'],'attributes':_0x2ce554['attributes'],'include':_0x2ce554['include']?_[_0x6ff2('0x1a')](_0x2ce554[_0x6ff2('0x19')],function(_0x3a1eee){return{'model':db[_0x3a1eee[_0x6ff2('0x1b')]],'as':_0x3a1eee['as'],'attributes':_0x3a1eee[_0x6ff2('0x17')],'include':_0x3a1eee[_0x6ff2('0x19')]?_[_0x6ff2('0x1a')](_0x3a1eee['include'],function(_0xdd4b8c){return{'model':db[_0xdd4b8c[_0x6ff2('0x1b')]],'as':_0xdd4b8c['as'],'attributes':_0xdd4b8c[_0x6ff2('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xef8dc1){logger[_0x6ff2('0x9')](_0x6ff2('0x14'),_0x50a9d8);logger['debug'](_0x6ff2('0x14'),_0x50a9d8,JSON['stringify'](_0xef8dc1));_0x53377e(_0xef8dc1);})[_0x6ff2('0x13')](function(_0x1040fd){logger[_0x6ff2('0x10')](_0x6ff2('0x14'),_0x1040fd[_0x6ff2('0x11')],_0x50a9d8);_0x5267b0(_0x585be5[_0x6ff2('0x10')](0x1f4,_0x1040fd['message']));});});};exports['ShowTrunk']=function(_0x55b67b){var _0x5f5b09=this;return new Promise(function(_0x546c56,_0x589c22){return db['Trunk'][_0x6ff2('0x1c')]({'raw':_0x55b67b['options']?_0x55b67b[_0x6ff2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x55b67b[_0x6ff2('0x16')]?_0x55b67b[_0x6ff2('0x16')][_0x6ff2('0x1d')]||null:null,'attributes':_0x55b67b[_0x6ff2('0x16')]?_0x55b67b[_0x6ff2('0x16')][_0x6ff2('0x17')]||null:null,'include':_0x55b67b['options']?_0x55b67b[_0x6ff2('0x16')][_0x6ff2('0x19')]?_[_0x6ff2('0x1a')](_0x55b67b[_0x6ff2('0x16')][_0x6ff2('0x19')],function(_0x33dc74){return{'model':db[_0x33dc74[_0x6ff2('0x1b')]],'as':_0x33dc74['as'],'attributes':_0x33dc74[_0x6ff2('0x17')],'include':_0x33dc74['include']?_['map'](_0x33dc74[_0x6ff2('0x19')],function(_0x484a1c){return{'model':db[_0x484a1c[_0x6ff2('0x1b')]],'as':_0x484a1c['as'],'attributes':_0x484a1c[_0x6ff2('0x17')],'include':_0x484a1c['include']?_[_0x6ff2('0x1a')](_0x484a1c[_0x6ff2('0x19')],function(_0x5f3248){return{'model':db[_0x5f3248[_0x6ff2('0x1b')]],'as':_0x5f3248['as'],'attributes':_0x5f3248['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ff2('0x8')](function(_0x1ca6ab){logger[_0x6ff2('0x9')]('ShowTrunk',_0x55b67b);logger[_0x6ff2('0xc')](_0x6ff2('0x1e'),_0x55b67b,JSON['stringify'](_0x1ca6ab));_0x546c56(_0x1ca6ab);})['catch'](function(_0x1ec444){logger[_0x6ff2('0x10')](_0x6ff2('0x1e'),_0x1ec444['message'],_0x55b67b);_0x589c22(_0x5f5b09[_0x6ff2('0x10')](0x1f4,_0x1ec444['message']));});});};
\ No newline at end of file
+var _0x354a=['limit','include','model','attributes','map','then','debug','catch','ShowTrunk','find','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetTrunk','Trunk','findAll','options','raw','where'];(function(_0x3f3adc,_0x48e732){var _0x5e5edf=function(_0x3900e3){while(--_0x3900e3){_0x3f3adc['push'](_0x3f3adc['shift']());}};_0x5e5edf(++_0x48e732);}(_0x354a,0xd6));var _0xa354=function(_0x4e18bb,_0x2b28df){_0x4e18bb=_0x4e18bb-0x0;var _0x5ebf1f=_0x354a[_0x4e18bb];return _0x5ebf1f;};'use strict';var _=require('lodash');var util=require(_0xa354('0x0'));var moment=require('moment');var BPromise=require(_0xa354('0x1'));var rs=require(_0xa354('0x2'));var fs=require('fs');var Redis=require(_0xa354('0x3'));var db=require(_0xa354('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa354('0x5'));var config=require(_0xa354('0x6'));var jayson=require(_0xa354('0x7'));var client=jayson['client'][_0xa354('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c10d8,_0x4479c1,_0xe3b4a6){return new BPromise(function(_0x4a87b9,_0x492f41){return client[_0xa354('0x9')](_0x3c10d8,_0xe3b4a6)['then'](function(_0x2712fe){logger[_0xa354('0xa')](_0xa354('0xb'),_0x4479c1,_0xa354('0xc'));logger['debug'](_0xa354('0xd'),_0x4479c1,_0xa354('0xc'),JSON[_0xa354('0xe')](_0x2712fe));if(_0x2712fe[_0xa354('0xf')]){if(_0x2712fe[_0xa354('0xf')]['code']===0x1f4){logger[_0xa354('0xf')]('Trunk,\x20%s,\x20%s',_0x4479c1,_0x2712fe[_0xa354('0xf')][_0xa354('0x10')]);return _0x492f41(_0x2712fe[_0xa354('0xf')][_0xa354('0x10')]);}logger[_0xa354('0xf')](_0xa354('0xb'),_0x4479c1,_0x2712fe[_0xa354('0xf')][_0xa354('0x10')]);return _0x4a87b9(_0x2712fe['error']['message']);}else{logger[_0xa354('0xa')](_0xa354('0xb'),_0x4479c1,_0xa354('0xc'));_0x4a87b9(_0x2712fe[_0xa354('0x11')][_0xa354('0x10')]);}})['catch'](function(_0x248e18){logger[_0xa354('0xf')](_0xa354('0xb'),_0x4479c1,_0x248e18);_0x492f41(_0x248e18);});});}exports[_0xa354('0x12')]=function(_0x252123){var _0x4d5032=this;return new Promise(function(_0x54b3d6,_0xf0cf12){return db[_0xa354('0x13')][_0xa354('0x14')]({'raw':_0x252123[_0xa354('0x15')]?_0x252123[_0xa354('0x15')][_0xa354('0x16')]===undefined?!![]:![]:!![],'where':_0x252123[_0xa354('0x15')]?_0x252123[_0xa354('0x15')][_0xa354('0x17')]||null:null,'attributes':_0x252123['options']?_0x252123[_0xa354('0x15')]['attributes']||null:null,'limit':_0x252123[_0xa354('0x15')]?_0x252123[_0xa354('0x15')][_0xa354('0x18')]||null:null,'include':_0x252123[_0xa354('0x15')]?_0x252123[_0xa354('0x15')]['include']?_['map'](_0x252123[_0xa354('0x15')][_0xa354('0x19')],function(_0x57d46e){return{'model':db[_0x57d46e[_0xa354('0x1a')]],'as':_0x57d46e['as'],'attributes':_0x57d46e[_0xa354('0x1b')],'include':_0x57d46e[_0xa354('0x19')]?_['map'](_0x57d46e[_0xa354('0x19')],function(_0x4dd2ac){return{'model':db[_0x4dd2ac[_0xa354('0x1a')]],'as':_0x4dd2ac['as'],'attributes':_0x4dd2ac['attributes'],'include':_0x4dd2ac[_0xa354('0x19')]?_[_0xa354('0x1c')](_0x4dd2ac['include'],function(_0x5a831f){return{'model':db[_0x5a831f[_0xa354('0x1a')]],'as':_0x5a831f['as'],'attributes':_0x5a831f[_0xa354('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa354('0x1d')](function(_0x3d73dd){logger[_0xa354('0xa')](_0xa354('0x12'),_0x252123);logger[_0xa354('0x1e')](_0xa354('0x12'),_0x252123,JSON[_0xa354('0xe')](_0x3d73dd));_0x54b3d6(_0x3d73dd);})[_0xa354('0x1f')](function(_0x18e137){logger[_0xa354('0xf')](_0xa354('0x12'),_0x18e137[_0xa354('0x10')],_0x252123);_0xf0cf12(_0x4d5032[_0xa354('0xf')](0x1f4,_0x18e137[_0xa354('0x10')]));});});};exports[_0xa354('0x20')]=function(_0x41994f){var _0x382f49=this;return new Promise(function(_0x408f50,_0x51610e){return db[_0xa354('0x13')][_0xa354('0x21')]({'raw':_0x41994f['options']?_0x41994f['options']['raw']===undefined?!![]:![]:!![],'where':_0x41994f[_0xa354('0x15')]?_0x41994f['options'][_0xa354('0x17')]||null:null,'attributes':_0x41994f[_0xa354('0x15')]?_0x41994f[_0xa354('0x15')]['attributes']||null:null,'include':_0x41994f['options']?_0x41994f[_0xa354('0x15')][_0xa354('0x19')]?_[_0xa354('0x1c')](_0x41994f[_0xa354('0x15')][_0xa354('0x19')],function(_0x16fd8e){return{'model':db[_0x16fd8e[_0xa354('0x1a')]],'as':_0x16fd8e['as'],'attributes':_0x16fd8e[_0xa354('0x1b')],'include':_0x16fd8e[_0xa354('0x19')]?_[_0xa354('0x1c')](_0x16fd8e[_0xa354('0x19')],function(_0x133f3c){return{'model':db[_0x133f3c[_0xa354('0x1a')]],'as':_0x133f3c['as'],'attributes':_0x133f3c[_0xa354('0x1b')],'include':_0x133f3c[_0xa354('0x19')]?_[_0xa354('0x1c')](_0x133f3c[_0xa354('0x19')],function(_0x416002){return{'model':db[_0x416002[_0xa354('0x1a')]],'as':_0x416002['as'],'attributes':_0x416002[_0xa354('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa354('0x1d')](function(_0xf70ce8){logger[_0xa354('0xa')]('ShowTrunk',_0x41994f);logger[_0xa354('0x1e')]('ShowTrunk',_0x41994f,JSON[_0xa354('0xe')](_0xf70ce8));_0x408f50(_0xf70ce8);})['catch'](function(_0x79e300){logger[_0xa354('0xf')]('ShowTrunk',_0x79e300[_0xa354('0x10')],_0x41994f);_0x51610e(_0x382f49[_0xa354('0xf')](0x1f4,_0x79e300['message']));});});};
\ No newline at end of file