This commit is contained in:
aozhiwei 2020-10-30 14:18:03 +08:00
parent 2b44cacbc0
commit 762c589b75

View File

@ -203,8 +203,21 @@ func (this *RiskMgr) __opsDump(w* http.ResponseWriter, r *http.Request) {
defer this.launchBlackListMutex.Unlock()
defer this.blockProvinceCityHashMutex.Unlock()
xobj := q5.NewMxoObject()
xobj.SetXValue("errcode", q5.NewXInt32(0))
xobj.SetXValue("errcode", q5.NewXString(""))
q5.Response(w, xobj.ToJsonStr())
fillRespObj := func(respObj* q5.MutableXObject, attrName string, mapObj* map[string]int32) {
list := q5.NewMxoArray()
for key, _ := range *mapObj {
list.PushXValue(q5.NewXString(key))
}
respObj.SetXObject(attrName, list.AsXObject())
}
respObj := q5.NewMxoObject()
respObj.SetXValue("errcode", q5.NewXInt32(0))
respObj.SetXValue("errcode", q5.NewXString(""))
fillRespObj(respObj, "ip_white_list", &this.ipWhiteList)
fillRespObj(respObj, "ip_black_list", &this.ipBlackList)
fillRespObj(respObj, "launch_white_list", &this.launchWhiteList)
fillRespObj(respObj, "launch_black_list", &this.launchBlackList)
fillRespObj(respObj, "block_province_city_list", &this.blockProvinceCityHash)
q5.Response(w, respObj.ToJsonStr())
}