增加IP级别和WAF动作相关API

This commit is contained in:
GoEdgeLab
2021-02-06 17:38:04 +08:00
parent 4a50827089
commit 8d13ee1ce9
17 changed files with 447 additions and 140 deletions

View File

@@ -0,0 +1,19 @@
package models
import (
"encoding/json"
"github.com/iwind/TeaGo/maps"
)
// 解析参数
func (this *NodeClusterFirewallAction) DecodeParams() (maps.Map, error) {
if IsNotNull(this.Params) {
params := maps.Map{}
err := json.Unmarshal([]byte(this.Params), &params)
if err != nil {
return nil, err
}
return params, nil
}
return maps.Map{}, nil
}