From 6a8599cdb3844cc170ea796e8515a1f0368063d5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 12 Nov 2020 19:20:23 +0800 Subject: [PATCH] 1 --- server/analyseapi/riskmgr.go | 34 ++-------------------------------- server/analyseapi/types.go | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index fcdc952..371fc76 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -63,8 +63,8 @@ func (this* RiskMgr) UnInit() { } func (this* RiskMgr) OutputLog() { - f5.SysLog().Info("passobj %s", this.GetPassObj().ToJsonStr()) - f5.SysLog().Info("blockobj %s", this.GetBlockObj().ToJsonStr()) + //f5.SysLog().Info("passobj %s", this.GetPassObj().ToJsonStr()) + //f5.SysLog().Info("blockobj %s", this.GetBlockObj().ToJsonStr()) atomic.StoreInt64(&this.passTimes, 0) atomic.StoreInt64(&this.blockTimes, 0) atomic.StoreInt64(&this.passTimes, 0) @@ -79,36 +79,6 @@ func (this* RiskMgr) GetSdkInfo(accessKeyId* string, accessSecret* string) { *accessSecret = "" + this.accessSecret } -func (this* RiskMgr) GetPassObj() *q5.XObject { - passObj := q5.NewMxoObject() - passObj.SetXValue("total_times", q5.NewXInt64(this.totalPassTimes)) - passObj.SetXValue("curr_times", q5.NewXInt64(this.passTimes)) - /*passObj.SetXValue("total_white_ip_times", q5.NewXInt64(this.totalIpWhiteListPassTimes)) - passObj.SetXValue("curr_white_ip_times", q5.NewXInt64(this.ipWhiteListPassTimes)) - passObj.SetXValue("total_white_launch_times", q5.NewXInt64(this.totalLaunchWhiteListPassTimes)) - passObj.SetXValue("curr_white_launch_times", q5.NewXInt64(this.launchWhiteListPassTimes)) - passObj.SetXValue("total_safezone_times", q5.NewXInt64(this.totalSafeZonePassTimes)) - passObj.SetXValue("curr_safezone_times", q5.NewXInt64(this.safeZonePassTimes))*/ - return passObj.AsXObject() -} - -func (this* RiskMgr) GetBlockObj() *q5.XObject { - blockObj := q5.NewMxoObject() - blockObj.SetXValue("total_times", q5.NewXInt64(this.totalBlockTimes)) - blockObj.SetXValue("curr_times", q5.NewXInt64(this.blockTimes)) - /*blockObj.SetXValue("total_method_err_times", q5.NewXInt64(this.totalHttpMethodBlockTimes)) - blockObj.SetXValue("curr_method_err_times", q5.NewXInt64(this.httpMethodBlockTimes)) - blockObj.SetXValue("total_session_err_times", q5.NewXInt64(this.totalSessionErrBlockTimes)) - blockObj.SetXValue("curr_session_err_times", q5.NewXInt64(this.sessionErrBlockTimes)) - blockObj.SetXValue("total_black_ip_times", q5.NewXInt64(this.totalIpBlackListBlockTimes)) - blockObj.SetXValue("curr_black_ip_times", q5.NewXInt64(this.ipBlackListBlockTimes)) - blockObj.SetXValue("total_black_launch_times", q5.NewXInt64(this.totalLaunchBlackListBlockTimes)) - blockObj.SetXValue("curr_black_launch_times", q5.NewXInt64(this.launchBlackListBlockTimes)) - blockObj.SetXValue("total_unsafezone_times", q5.NewXInt64(this.totalUnSafeZoneBlockTimes)) - blockObj.SetXValue("curr_unsafezone_times", q5.NewXInt64(this.unSafeZoneBlockTimes))*/ - return blockObj.AsXObject() -} - func (this *RiskMgr) GetGameConf(gameId int32, channel int32) *GameConf { return nil } diff --git a/server/analyseapi/types.go b/server/analyseapi/types.go index 84958d7..ffd5a87 100644 --- a/server/analyseapi/types.go +++ b/server/analyseapi/types.go @@ -231,10 +231,26 @@ func (this* GameConf) Dump() *q5.MutableXObject { func (this* GameConf) GetPassObj() *q5.XObject { passObj := q5.NewMxoObject() + /*passObj.SetXValue("total_white_ip_times", q5.NewXInt64(this.totalIpWhiteListPassTimes)) + passObj.SetXValue("curr_white_ip_times", q5.NewXInt64(this.ipWhiteListPassTimes)) + passObj.SetXValue("total_white_launch_times", q5.NewXInt64(this.totalLaunchWhiteListPassTimes)) + passObj.SetXValue("curr_white_launch_times", q5.NewXInt64(this.launchWhiteListPassTimes)) + passObj.SetXValue("total_safezone_times", q5.NewXInt64(this.totalSafeZonePassTimes)) + passObj.SetXValue("curr_safezone_times", q5.NewXInt64(this.safeZonePassTimes))*/ return passObj.AsXObject() } func (this* GameConf) GetBlockObj() *q5.XObject { blockObj := q5.NewMxoObject() + /*blockObj.SetXValue("total_method_err_times", q5.NewXInt64(this.totalHttpMethodBlockTimes)) + blockObj.SetXValue("curr_method_err_times", q5.NewXInt64(this.httpMethodBlockTimes)) + blockObj.SetXValue("total_session_err_times", q5.NewXInt64(this.totalSessionErrBlockTimes)) + blockObj.SetXValue("curr_session_err_times", q5.NewXInt64(this.sessionErrBlockTimes)) + blockObj.SetXValue("total_black_ip_times", q5.NewXInt64(this.totalIpBlackListBlockTimes)) + blockObj.SetXValue("curr_black_ip_times", q5.NewXInt64(this.ipBlackListBlockTimes)) + blockObj.SetXValue("total_black_launch_times", q5.NewXInt64(this.totalLaunchBlackListBlockTimes)) + blockObj.SetXValue("curr_black_launch_times", q5.NewXInt64(this.launchBlackListBlockTimes)) + blockObj.SetXValue("total_unsafezone_times", q5.NewXInt64(this.totalUnSafeZoneBlockTimes)) + blockObj.SetXValue("curr_unsafezone_times", q5.NewXInt64(this.unSafeZoneBlockTimes))*/ return blockObj.AsXObject() }