Built motion from commit (unavailable).|2.4.3
[motion2.git] / server / api / trunk / trunk.rpc.js
index 087b201..0dceca2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f2=['where','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','options','raw','limit','include','map','model','attributes','then','ShowTrunk'];(function(_0x414b51,_0x2418e0){var _0x23f66a=function(_0x9596a6){while(--_0x9596a6){_0x414b51['push'](_0x414b51['shift']());}};_0x23f66a(++_0x2418e0);}(_0x70f2,0x1e1));var _0x270f=function(_0xc54d75,_0x449c91){_0xc54d75=_0xc54d75-0x0;var _0x4ae4ff=_0x70f2[_0xc54d75];return _0x4ae4ff;};'use strict';var _=require(_0x270f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x270f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x270f('0x2'));var db=require(_0x270f('0x3'))['db'];var utils=require(_0x270f('0x4'));var logger=require(_0x270f('0x5'))('rpc');var config=require(_0x270f('0x6'));var jayson=require(_0x270f('0x7'));var client=jayson['client'][_0x270f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ed62c,_0x12bc63,_0x37abb0){return new BPromise(function(_0x333327,_0x5a54f3){return client[_0x270f('0x9')](_0x1ed62c,_0x37abb0)['then'](function(_0x18c435){logger[_0x270f('0xa')]('Trunk,\x20%s,\x20%s',_0x12bc63,'request\x20sent');logger[_0x270f('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x12bc63,_0x270f('0xc'),JSON[_0x270f('0xd')](_0x18c435));if(_0x18c435['error']){if(_0x18c435[_0x270f('0xe')][_0x270f('0xf')]===0x1f4){logger['error'](_0x270f('0x10'),_0x12bc63,_0x18c435[_0x270f('0xe')]['message']);return _0x5a54f3(_0x18c435['error'][_0x270f('0x11')]);}logger[_0x270f('0xe')]('Trunk,\x20%s,\x20%s',_0x12bc63,_0x18c435[_0x270f('0xe')][_0x270f('0x11')]);return _0x333327(_0x18c435[_0x270f('0xe')][_0x270f('0x11')]);}else{logger[_0x270f('0xa')](_0x270f('0x10'),_0x12bc63,_0x270f('0xc'));_0x333327(_0x18c435[_0x270f('0x12')]['message']);}})[_0x270f('0x13')](function(_0x4baa0a){logger[_0x270f('0xe')](_0x270f('0x10'),_0x12bc63,_0x4baa0a);_0x5a54f3(_0x4baa0a);});});}exports[_0x270f('0x14')]=function(_0xafbaaf){var _0x3d677d=this;return new Promise(function(_0x114329,_0x3b5fa2){return db[_0x270f('0x15')]['findAll']({'raw':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')][_0x270f('0x17')]===undefined?!![]:![]:!![],'where':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')]['where']||null:null,'attributes':_0xafbaaf[_0x270f('0x16')]?_0xafbaaf[_0x270f('0x16')]['attributes']||null:null,'limit':_0xafbaaf[_0x270f('0x16')]?_0xafbaaf[_0x270f('0x16')][_0x270f('0x18')]||null:null,'include':_0xafbaaf['options']?_0xafbaaf[_0x270f('0x16')][_0x270f('0x19')]?_[_0x270f('0x1a')](_0xafbaaf['options'][_0x270f('0x19')],function(_0x111ed3){return{'model':db[_0x111ed3[_0x270f('0x1b')]],'as':_0x111ed3['as'],'attributes':_0x111ed3['attributes'],'include':_0x111ed3[_0x270f('0x19')]?_[_0x270f('0x1a')](_0x111ed3[_0x270f('0x19')],function(_0x58cc8a){return{'model':db[_0x58cc8a['model']],'as':_0x58cc8a['as'],'attributes':_0x58cc8a[_0x270f('0x1c')],'include':_0x58cc8a[_0x270f('0x19')]?_[_0x270f('0x1a')](_0x58cc8a[_0x270f('0x19')],function(_0x164668){return{'model':db[_0x164668[_0x270f('0x1b')]],'as':_0x164668['as'],'attributes':_0x164668[_0x270f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x270f('0x1d')](function(_0xcb5bd6){logger[_0x270f('0xa')](_0x270f('0x14'),_0xafbaaf);logger['debug'](_0x270f('0x14'),_0xafbaaf,JSON['stringify'](_0xcb5bd6));_0x114329(_0xcb5bd6);})[_0x270f('0x13')](function(_0x51996f){logger[_0x270f('0xe')](_0x270f('0x14'),_0x51996f[_0x270f('0x11')],_0xafbaaf);_0x3b5fa2(_0x3d677d['error'](0x1f4,_0x51996f[_0x270f('0x11')]));});});};exports[_0x270f('0x1e')]=function(_0x413081){var _0x35d0d3=this;return new Promise(function(_0x3cd773,_0x522614){return db['Trunk']['find']({'raw':_0x413081[_0x270f('0x16')]?_0x413081['options'][_0x270f('0x17')]===undefined?!![]:![]:!![],'where':_0x413081['options']?_0x413081[_0x270f('0x16')][_0x270f('0x1f')]||null:null,'attributes':_0x413081[_0x270f('0x16')]?_0x413081['options'][_0x270f('0x1c')]||null:null,'include':_0x413081['options']?_0x413081[_0x270f('0x16')][_0x270f('0x19')]?_['map'](_0x413081['options'][_0x270f('0x19')],function(_0x129dae){return{'model':db[_0x129dae['model']],'as':_0x129dae['as'],'attributes':_0x129dae['attributes'],'include':_0x129dae['include']?_[_0x270f('0x1a')](_0x129dae['include'],function(_0xa2112a){return{'model':db[_0xa2112a[_0x270f('0x1b')]],'as':_0xa2112a['as'],'attributes':_0xa2112a[_0x270f('0x1c')],'include':_0xa2112a['include']?_[_0x270f('0x1a')](_0xa2112a[_0x270f('0x19')],function(_0x5f2b94){return{'model':db[_0x5f2b94[_0x270f('0x1b')]],'as':_0x5f2b94['as'],'attributes':_0x5f2b94[_0x270f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fec80){logger[_0x270f('0xa')](_0x270f('0x1e'),_0x413081);logger[_0x270f('0xb')]('ShowTrunk',_0x413081,JSON['stringify'](_0x1fec80));_0x3cd773(_0x1fec80);})[_0x270f('0x13')](function(_0xba1650){logger[_0x270f('0xe')](_0x270f('0x1e'),_0xba1650[_0x270f('0x11')],_0x413081);_0x522614(_0x35d0d3[_0x270f('0xe')](0x1f4,_0xba1650['message']));});});};
\ No newline at end of file
+var _0x9785=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrunk','findAll','options','raw','where','attributes','include','map','model','Trunk','find','ShowTrunk','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9785,0x135));var _0x5978=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x9785[_0x32d457];return _0x338386;};'use strict';var _=require(_0x5978('0x0'));var util=require('util');var moment=require(_0x5978('0x1'));var BPromise=require(_0x5978('0x2'));var rs=require(_0x5978('0x3'));var fs=require('fs');var Redis=require(_0x5978('0x4'));var db=require(_0x5978('0x5'))['db'];var utils=require(_0x5978('0x6'));var logger=require(_0x5978('0x7'))('rpc');var config=require(_0x5978('0x8'));var jayson=require(_0x5978('0x9'));var client=jayson['client'][_0x5978('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10fbc2,_0x414cc1,_0x354d14){return new BPromise(function(_0x3ad10c,_0x5cc9a3){return client[_0x5978('0xb')](_0x10fbc2,_0x354d14)[_0x5978('0xc')](function(_0xccbf77){logger['info'](_0x5978('0xd'),_0x414cc1,_0x5978('0xe'));logger[_0x5978('0xf')](_0x5978('0x10'),_0x414cc1,_0x5978('0xe'),JSON[_0x5978('0x11')](_0xccbf77));if(_0xccbf77['error']){if(_0xccbf77[_0x5978('0x12')]['code']===0x1f4){logger[_0x5978('0x12')](_0x5978('0xd'),_0x414cc1,_0xccbf77[_0x5978('0x12')]['message']);return _0x5cc9a3(_0xccbf77[_0x5978('0x12')]['message']);}logger[_0x5978('0x12')](_0x5978('0xd'),_0x414cc1,_0xccbf77[_0x5978('0x12')][_0x5978('0x13')]);return _0x3ad10c(_0xccbf77[_0x5978('0x12')]['message']);}else{logger[_0x5978('0x14')](_0x5978('0xd'),_0x414cc1,_0x5978('0xe'));_0x3ad10c(_0xccbf77[_0x5978('0x15')][_0x5978('0x13')]);}})[_0x5978('0x16')](function(_0x1fb8eb){logger['error'](_0x5978('0xd'),_0x414cc1,_0x1fb8eb);_0x5cc9a3(_0x1fb8eb);});});}exports[_0x5978('0x17')]=function(_0x12b0a8){var _0x495ab2=this;return new Promise(function(_0x219382,_0xc32016){return db['Trunk'][_0x5978('0x18')]({'raw':_0x12b0a8['options']?_0x12b0a8[_0x5978('0x19')][_0x5978('0x1a')]===undefined?!![]:![]:!![],'where':_0x12b0a8[_0x5978('0x19')]?_0x12b0a8[_0x5978('0x19')][_0x5978('0x1b')]||null:null,'attributes':_0x12b0a8[_0x5978('0x19')]?_0x12b0a8[_0x5978('0x19')][_0x5978('0x1c')]||null:null,'limit':_0x12b0a8[_0x5978('0x19')]?_0x12b0a8[_0x5978('0x19')]['limit']||null:null,'include':_0x12b0a8[_0x5978('0x19')]?_0x12b0a8[_0x5978('0x19')][_0x5978('0x1d')]?_[_0x5978('0x1e')](_0x12b0a8[_0x5978('0x19')][_0x5978('0x1d')],function(_0x5efdff){return{'model':db[_0x5efdff[_0x5978('0x1f')]],'as':_0x5efdff['as'],'attributes':_0x5efdff['attributes'],'include':_0x5efdff[_0x5978('0x1d')]?_[_0x5978('0x1e')](_0x5efdff[_0x5978('0x1d')],function(_0x4fe373){return{'model':db[_0x4fe373[_0x5978('0x1f')]],'as':_0x4fe373['as'],'attributes':_0x4fe373['attributes'],'include':_0x4fe373[_0x5978('0x1d')]?_[_0x5978('0x1e')](_0x4fe373[_0x5978('0x1d')],function(_0x4df3fc){return{'model':db[_0x4df3fc[_0x5978('0x1f')]],'as':_0x4df3fc['as'],'attributes':_0x4df3fc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x230dc5){logger[_0x5978('0x14')](_0x5978('0x17'),_0x12b0a8);logger['debug'](_0x5978('0x17'),_0x12b0a8,JSON[_0x5978('0x11')](_0x230dc5));_0x219382(_0x230dc5);})[_0x5978('0x16')](function(_0x15e6a4){logger['error']('GetTrunk',_0x15e6a4[_0x5978('0x13')],_0x12b0a8);_0xc32016(_0x495ab2[_0x5978('0x12')](0x1f4,_0x15e6a4[_0x5978('0x13')]));});});};exports['ShowTrunk']=function(_0x7c074c){var _0x3fad2d=this;return new Promise(function(_0x57291e,_0x48dcfb){return db[_0x5978('0x20')][_0x5978('0x21')]({'raw':_0x7c074c[_0x5978('0x19')]?_0x7c074c[_0x5978('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x7c074c[_0x5978('0x19')]?_0x7c074c[_0x5978('0x19')][_0x5978('0x1b')]||null:null,'attributes':_0x7c074c['options']?_0x7c074c[_0x5978('0x19')][_0x5978('0x1c')]||null:null,'include':_0x7c074c[_0x5978('0x19')]?_0x7c074c[_0x5978('0x19')]['include']?_[_0x5978('0x1e')](_0x7c074c[_0x5978('0x19')]['include'],function(_0x589c74){return{'model':db[_0x589c74[_0x5978('0x1f')]],'as':_0x589c74['as'],'attributes':_0x589c74[_0x5978('0x1c')],'include':_0x589c74[_0x5978('0x1d')]?_[_0x5978('0x1e')](_0x589c74[_0x5978('0x1d')],function(_0x50f44a){return{'model':db[_0x50f44a[_0x5978('0x1f')]],'as':_0x50f44a['as'],'attributes':_0x50f44a['attributes'],'include':_0x50f44a['include']?_[_0x5978('0x1e')](_0x50f44a[_0x5978('0x1d')],function(_0x264a64){return{'model':db[_0x264a64[_0x5978('0x1f')]],'as':_0x264a64['as'],'attributes':_0x264a64[_0x5978('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5978('0xc')](function(_0x545185){logger[_0x5978('0x14')](_0x5978('0x22'),_0x7c074c);logger[_0x5978('0xf')]('ShowTrunk',_0x7c074c,JSON[_0x5978('0x11')](_0x545185));_0x57291e(_0x545185);})[_0x5978('0x16')](function(_0x191aa4){logger[_0x5978('0x12')](_0x5978('0x22'),_0x191aa4['message'],_0x7c074c);_0x48dcfb(_0x3fad2d[_0x5978('0x12')](0x1f4,_0x191aa4[_0x5978('0x13')]));});});};
\ No newline at end of file