This commit is contained in:
aozhiwei 2021-01-07 15:28:31 +08:00
parent 10b2c26b9d
commit 4a4e11896c

View File

@ -248,20 +248,45 @@ func (this *RiskMgr) _opsSyncConf(c *f5.Context) {
}
func (this *RiskMgr) _opsInfo(c *f5.Context) {
gameId := c.Request("gameid").GetInt32()
channel := c.Request("channel").GetInt32()
gameConf := this.GetGameConf(gameId, channel)
if gameConf == nil {
c.ResponseErr(1, "数据不存在")
return
}
gameConf.Active()
this.gameHashMutex.Lock()
defer this.gameHashMutex.Unlock()
respObj := q5.NewMxoObject()
respObj.SetXValue("errcode", q5.NewXInt32(0))
respObj.SetXValue("errmsg", q5.NewXString(""))
respObj.SetXObject("conf", gameConf.GetConfObj())
respObj.SetXObject("pass", gameConf.GetPassObj())
respObj.SetXObject("block", gameConf.GetBlockObj())
{
passObj := q5.NewMxoObject()
passObj.SetXValue("total", q5.NewXInt64(this.totalPassTimes))
respObj.SetXValue("curr", q5.NewXInt64(this.passTimes))
respObj.SetXValue("total_ip_whitelist", q5.NewXInt64(this.totalIpWhiteListPassTimes))
respObj.SetXValue("curr_ip_whitelist", q5.NewXInt64(this.ipWhiteListPassTimes))
respObj.SetXObject("pass", passObj.AsXObject())
}
{
blockObj := q5.NewMxoObject()
respObj.SetXValue("total", q5.NewXInt64(this.totalBlockTimes))
respObj.SetXValue("curr", q5.NewXInt64(this.blockTimes))
respObj.SetXValue("total_ip_blacklist", q5.NewXInt64(this.totalIpBlackListBlockTimes))
respObj.SetXValue("curr_ip_blacklist", q5.NewXInt64(this.ipBlackListBlockTimes))
respObj.SetXValue("total_http_method", q5.NewXInt64(this.totalHttpMethodBlockTimes))
respObj.SetXValue("http_method", q5.NewXInt64(this.httpMethodBlockTimes))
respObj.SetXObject("block", blockObj.AsXObject())
}
respObj.SetXValue("errcode", q5.NewXInt64(this.totalSessionErrBlockTimes))
respObj.SetXValue("errcode", q5.NewXInt64(this.totalSessionErrBlockTimes))
gameList := q5.NewMxoArray()
for _, gameConf := range this.fetchGameConfList() {
gameConf.Active()
gameObj := q5.NewMxoObject()
gameObj.SetXValue("gameid", q5.NewXInt32(gameConf.gameId))
gameObj.SetXValue("channel", q5.NewXInt32(gameConf.channel))
gameObj.SetXObject("conf", gameConf.GetConfObj())
gameObj.SetXObject("pass", gameConf.GetPassObj())
gameObj.SetXObject("block", gameConf.GetBlockObj())
gameList.PushXObject(gameObj.AsXObject())
}
respObj.SetXObject("games", gameList.AsXObject())
c.Response(respObj.ToJsonStr())
}