Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / trunk / trunk.rpc.js
index 3d62724..8ef3bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b16=['rpc','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','options','attributes','include','map','model','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x4b16,0x100));var _0x64b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4b16[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x64b1('0x0'));var util=require(_0x64b1('0x1'));var moment=require(_0x64b1('0x2'));var BPromise=require(_0x64b1('0x3'));var rs=require(_0x64b1('0x4'));var fs=require('fs');var Redis=require(_0x64b1('0x5'));var db=require(_0x64b1('0x6'))['db'];var utils=require(_0x64b1('0x7'));var logger=require('../../config/logger')(_0x64b1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x64b1('0x9')][_0x64b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3daa23,_0x40388c,_0x799aaa){return new BPromise(function(_0x265b86,_0x501c25){return client[_0x64b1('0xb')](_0x3daa23,_0x799aaa)[_0x64b1('0xc')](function(_0x1d5d3d){logger[_0x64b1('0xd')]('Trunk,\x20%s,\x20%s',_0x40388c,'request\x20sent');logger[_0x64b1('0xe')](_0x64b1('0xf'),_0x40388c,_0x64b1('0x10'),JSON[_0x64b1('0x11')](_0x1d5d3d));if(_0x1d5d3d[_0x64b1('0x12')]){if(_0x1d5d3d[_0x64b1('0x12')][_0x64b1('0x13')]===0x1f4){logger[_0x64b1('0x12')]('Trunk,\x20%s,\x20%s',_0x40388c,_0x1d5d3d[_0x64b1('0x12')][_0x64b1('0x14')]);return _0x501c25(_0x1d5d3d['error'][_0x64b1('0x14')]);}logger['error'](_0x64b1('0x15'),_0x40388c,_0x1d5d3d['error'][_0x64b1('0x14')]);return _0x265b86(_0x1d5d3d['error']['message']);}else{logger[_0x64b1('0xd')](_0x64b1('0x15'),_0x40388c,_0x64b1('0x10'));_0x265b86(_0x1d5d3d[_0x64b1('0x16')]['message']);}})[_0x64b1('0x17')](function(_0x2409ef){logger[_0x64b1('0x12')](_0x64b1('0x15'),_0x40388c,_0x2409ef);_0x501c25(_0x2409ef);});});}exports[_0x64b1('0x18')]=function(_0x4b494e){var _0x300b9f=this;return new Promise(function(_0x8ac812,_0x38d2c9){return db[_0x64b1('0x19')]['findAll']({'raw':_0x4b494e[_0x64b1('0x1a')]?_0x4b494e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b494e[_0x64b1('0x1a')]?_0x4b494e['options']['where']||null:null,'attributes':_0x4b494e[_0x64b1('0x1a')]?_0x4b494e['options'][_0x64b1('0x1b')]||null:null,'limit':_0x4b494e['options']?_0x4b494e[_0x64b1('0x1a')]['limit']||null:null,'include':_0x4b494e[_0x64b1('0x1a')]?_0x4b494e[_0x64b1('0x1a')][_0x64b1('0x1c')]?_[_0x64b1('0x1d')](_0x4b494e[_0x64b1('0x1a')][_0x64b1('0x1c')],function(_0x260daf){return{'model':db[_0x260daf[_0x64b1('0x1e')]],'as':_0x260daf['as'],'attributes':_0x260daf[_0x64b1('0x1b')],'include':_0x260daf[_0x64b1('0x1c')]?_[_0x64b1('0x1d')](_0x260daf[_0x64b1('0x1c')],function(_0x24dcb9){return{'model':db[_0x24dcb9[_0x64b1('0x1e')]],'as':_0x24dcb9['as'],'attributes':_0x24dcb9[_0x64b1('0x1b')],'include':_0x24dcb9['include']?_[_0x64b1('0x1d')](_0x24dcb9[_0x64b1('0x1c')],function(_0x110ef6){return{'model':db[_0x110ef6[_0x64b1('0x1e')]],'as':_0x110ef6['as'],'attributes':_0x110ef6[_0x64b1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e80b4){logger['info']('GetTrunk',_0x4b494e);logger[_0x64b1('0xe')](_0x64b1('0x18'),_0x4b494e,JSON[_0x64b1('0x11')](_0x3e80b4));_0x8ac812(_0x3e80b4);})[_0x64b1('0x17')](function(_0xca6034){logger['error'](_0x64b1('0x18'),_0xca6034[_0x64b1('0x14')],_0x4b494e);_0x38d2c9(_0x300b9f['error'](0x1f4,_0xca6034['message']));});});};exports[_0x64b1('0x1f')]=function(_0x5f5d73){var _0x4a2851=this;return new Promise(function(_0x5e25b6,_0x346559){return db[_0x64b1('0x19')]['find']({'raw':_0x5f5d73[_0x64b1('0x1a')]?_0x5f5d73[_0x64b1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5f5d73[_0x64b1('0x1a')]?_0x5f5d73[_0x64b1('0x1a')][_0x64b1('0x20')]||null:null,'attributes':_0x5f5d73[_0x64b1('0x1a')]?_0x5f5d73[_0x64b1('0x1a')][_0x64b1('0x1b')]||null:null,'include':_0x5f5d73['options']?_0x5f5d73[_0x64b1('0x1a')]['include']?_['map'](_0x5f5d73['options'][_0x64b1('0x1c')],function(_0x48fcf0){return{'model':db[_0x48fcf0[_0x64b1('0x1e')]],'as':_0x48fcf0['as'],'attributes':_0x48fcf0['attributes'],'include':_0x48fcf0[_0x64b1('0x1c')]?_[_0x64b1('0x1d')](_0x48fcf0[_0x64b1('0x1c')],function(_0x32bd92){return{'model':db[_0x32bd92[_0x64b1('0x1e')]],'as':_0x32bd92['as'],'attributes':_0x32bd92[_0x64b1('0x1b')],'include':_0x32bd92[_0x64b1('0x1c')]?_[_0x64b1('0x1d')](_0x32bd92[_0x64b1('0x1c')],function(_0x45ce3e){return{'model':db[_0x45ce3e[_0x64b1('0x1e')]],'as':_0x45ce3e['as'],'attributes':_0x45ce3e[_0x64b1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x64b1('0xc')](function(_0x3864e5){logger[_0x64b1('0xd')]('ShowTrunk',_0x5f5d73);logger[_0x64b1('0xe')](_0x64b1('0x1f'),_0x5f5d73,JSON['stringify'](_0x3864e5));_0x5e25b6(_0x3864e5);})[_0x64b1('0x17')](function(_0x4a502a){logger[_0x64b1('0x12')](_0x64b1('0x1f'),_0x4a502a[_0x64b1('0x14')],_0x5f5d73);_0x346559(_0x4a2851[_0x64b1('0x12')](0x1f4,_0x4a502a['message']));});});};
\ No newline at end of file
+var _0x8874=['ShowTrunk','find','raw','then','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Trunk,\x20%s,\x20%s','catch','Trunk','findAll','options','where','attributes','limit','model','include','map','stringify','GetTrunk'];(function(_0x2318c9,_0x446462){var _0x33894b=function(_0x4afc00){while(--_0x4afc00){_0x2318c9['push'](_0x2318c9['shift']());}};_0x33894b(++_0x446462);}(_0x8874,0xf2));var _0x4887=function(_0x2d7884,_0x3047f8){_0x2d7884=_0x2d7884-0x0;var _0x119d42=_0x8874[_0x2d7884];return _0x119d42;};'use strict';var _=require('lodash');var util=require(_0x4887('0x0'));var moment=require('moment');var BPromise=require(_0x4887('0x1'));var rs=require(_0x4887('0x2'));var fs=require('fs');var Redis=require(_0x4887('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4887('0x4'))(_0x4887('0x5'));var config=require('../../config/environment');var jayson=require(_0x4887('0x6'));var client=jayson[_0x4887('0x7')][_0x4887('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x426a0d,_0x92d415,_0x2f18e5){return new BPromise(function(_0x3a0b0a,_0x2bb8c6){return client[_0x4887('0x9')](_0x426a0d,_0x2f18e5)['then'](function(_0x5f50e7){logger[_0x4887('0xa')]('Trunk,\x20%s,\x20%s',_0x92d415,'request\x20sent');logger[_0x4887('0xb')](_0x4887('0xc'),_0x92d415,_0x4887('0xd'),JSON['stringify'](_0x5f50e7));if(_0x5f50e7[_0x4887('0xe')]){if(_0x5f50e7[_0x4887('0xe')][_0x4887('0xf')]===0x1f4){logger[_0x4887('0xe')]('Trunk,\x20%s,\x20%s',_0x92d415,_0x5f50e7[_0x4887('0xe')]['message']);return _0x2bb8c6(_0x5f50e7['error'][_0x4887('0x10')]);}logger[_0x4887('0xe')](_0x4887('0x11'),_0x92d415,_0x5f50e7[_0x4887('0xe')]['message']);return _0x3a0b0a(_0x5f50e7['error'][_0x4887('0x10')]);}else{logger[_0x4887('0xa')](_0x4887('0x11'),_0x92d415,'request\x20sent');_0x3a0b0a(_0x5f50e7['result'][_0x4887('0x10')]);}})[_0x4887('0x12')](function(_0xe8d9c7){logger[_0x4887('0xe')]('Trunk,\x20%s,\x20%s',_0x92d415,_0xe8d9c7);_0x2bb8c6(_0xe8d9c7);});});}exports['GetTrunk']=function(_0x2f4867){var _0xf40c73=this;return new Promise(function(_0x350333,_0x420fd1){return db[_0x4887('0x13')][_0x4887('0x14')]({'raw':_0x2f4867[_0x4887('0x15')]?_0x2f4867['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f4867[_0x4887('0x15')]?_0x2f4867['options'][_0x4887('0x16')]||null:null,'attributes':_0x2f4867[_0x4887('0x15')]?_0x2f4867[_0x4887('0x15')][_0x4887('0x17')]||null:null,'limit':_0x2f4867[_0x4887('0x15')]?_0x2f4867[_0x4887('0x15')][_0x4887('0x18')]||null:null,'include':_0x2f4867[_0x4887('0x15')]?_0x2f4867[_0x4887('0x15')]['include']?_['map'](_0x2f4867[_0x4887('0x15')]['include'],function(_0x50d5ca){return{'model':db[_0x50d5ca[_0x4887('0x19')]],'as':_0x50d5ca['as'],'attributes':_0x50d5ca[_0x4887('0x17')],'include':_0x50d5ca[_0x4887('0x1a')]?_[_0x4887('0x1b')](_0x50d5ca[_0x4887('0x1a')],function(_0xef700c){return{'model':db[_0xef700c[_0x4887('0x19')]],'as':_0xef700c['as'],'attributes':_0xef700c[_0x4887('0x17')],'include':_0xef700c['include']?_[_0x4887('0x1b')](_0xef700c[_0x4887('0x1a')],function(_0x15c7e7){return{'model':db[_0x15c7e7[_0x4887('0x19')]],'as':_0x15c7e7['as'],'attributes':_0x15c7e7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ada49){logger[_0x4887('0xa')]('GetTrunk',_0x2f4867);logger[_0x4887('0xb')]('GetTrunk',_0x2f4867,JSON[_0x4887('0x1c')](_0x2ada49));_0x350333(_0x2ada49);})[_0x4887('0x12')](function(_0x2b6674){logger['error'](_0x4887('0x1d'),_0x2b6674[_0x4887('0x10')],_0x2f4867);_0x420fd1(_0xf40c73['error'](0x1f4,_0x2b6674[_0x4887('0x10')]));});});};exports[_0x4887('0x1e')]=function(_0x590897){var _0x1d783b=this;return new Promise(function(_0x275503,_0x46d6bf){return db[_0x4887('0x13')][_0x4887('0x1f')]({'raw':_0x590897[_0x4887('0x15')]?_0x590897[_0x4887('0x15')][_0x4887('0x20')]===undefined?!![]:![]:!![],'where':_0x590897[_0x4887('0x15')]?_0x590897[_0x4887('0x15')][_0x4887('0x16')]||null:null,'attributes':_0x590897[_0x4887('0x15')]?_0x590897[_0x4887('0x15')][_0x4887('0x17')]||null:null,'include':_0x590897[_0x4887('0x15')]?_0x590897[_0x4887('0x15')]['include']?_[_0x4887('0x1b')](_0x590897[_0x4887('0x15')][_0x4887('0x1a')],function(_0x5d99cc){return{'model':db[_0x5d99cc[_0x4887('0x19')]],'as':_0x5d99cc['as'],'attributes':_0x5d99cc[_0x4887('0x17')],'include':_0x5d99cc[_0x4887('0x1a')]?_[_0x4887('0x1b')](_0x5d99cc['include'],function(_0x11d1c8){return{'model':db[_0x11d1c8[_0x4887('0x19')]],'as':_0x11d1c8['as'],'attributes':_0x11d1c8['attributes'],'include':_0x11d1c8[_0x4887('0x1a')]?_[_0x4887('0x1b')](_0x11d1c8[_0x4887('0x1a')],function(_0x4f179c){return{'model':db[_0x4f179c[_0x4887('0x19')]],'as':_0x4f179c['as'],'attributes':_0x4f179c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4887('0x21')](function(_0x2caa62){logger[_0x4887('0xa')](_0x4887('0x1e'),_0x590897);logger[_0x4887('0xb')](_0x4887('0x1e'),_0x590897,JSON['stringify'](_0x2caa62));_0x275503(_0x2caa62);})[_0x4887('0x12')](function(_0x4c4fb5){logger[_0x4887('0xe')](_0x4887('0x1e'),_0x4c4fb5[_0x4887('0x10')],_0x590897);_0x46d6bf(_0x1d783b[_0x4887('0xe')](0x1f4,_0x4c4fb5[_0x4887('0x10')]));});});};
\ No newline at end of file