From 8804f1680ea30b761549303fa6354a324587f15a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 12 Nov 2020 19:09:00 +0800 Subject: [PATCH] 1 --- server/analyseapi/riskmgr.go | 14 ++++++++++++-- server/analyseapi/types.go | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/server/analyseapi/riskmgr.go b/server/analyseapi/riskmgr.go index 601af2c..fcdc952 100644 --- a/server/analyseapi/riskmgr.go +++ b/server/analyseapi/riskmgr.go @@ -67,6 +67,9 @@ func (this* RiskMgr) OutputLog() { f5.SysLog().Info("blockobj %s", this.GetBlockObj().ToJsonStr()) atomic.StoreInt64(&this.passTimes, 0) atomic.StoreInt64(&this.blockTimes, 0) + atomic.StoreInt64(&this.passTimes, 0) + atomic.StoreInt64(&this.httpMethodBlockTimes, 0) + atomic.StoreInt64(&this.sessionErrBlockTimes, 0) } func (this* RiskMgr) GetSdkInfo(accessKeyId* string, accessSecret* string) { @@ -192,10 +195,17 @@ func (this *RiskMgr) __opsSyncConf(w* http.ResponseWriter, r *http.Request) { } func (this *RiskMgr) __opsInfo(w* http.ResponseWriter, r *http.Request) { + gameId := q5.Request(r, "gameid").GetInt32() + channel := q5.Request(r, "channel").GetInt32() + gameConf := this.GetGameConf(gameId, channel) + if gameConf == nil { + q5.ResponseErr(w, 1, "数据不存在") + return + } respObj := q5.NewMxoObject() respObj.SetXValue("errcode", q5.NewXInt32(0)) respObj.SetXValue("errmsg", q5.NewXString("")) - respObj.SetXObject("pass", this.GetPassObj()) - respObj.SetXObject("block", this.GetBlockObj()) + respObj.SetXObject("pass", gameConf.GetPassObj()) + respObj.SetXObject("block", gameConf.GetBlockObj()) q5.Response(w, respObj.ToJsonStr()) } diff --git a/server/analyseapi/types.go b/server/analyseapi/types.go index 0f000bf..84958d7 100644 --- a/server/analyseapi/types.go +++ b/server/analyseapi/types.go @@ -228,3 +228,13 @@ func (this* GameConf) Dump() *q5.MutableXObject { //fillRespObj(respObj, "fixed_block_province_city_list", &this.fixedBlockProvinceCityHash) return respObj } + +func (this* GameConf) GetPassObj() *q5.XObject { + passObj := q5.NewMxoObject() + return passObj.AsXObject() +} + +func (this* GameConf) GetBlockObj() *q5.XObject { + blockObj := q5.NewMxoObject() + return blockObj.AsXObject() +}