mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 17:40:24 +08:00
增加IP级别和WAF动作相关API
This commit is contained in:
19
internal/db/models/node_cluster_firewall_action_model_ext.go
Normal file
19
internal/db/models/node_cluster_firewall_action_model_ext.go
Normal 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), ¶ms)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return params, nil
|
||||
}
|
||||
return maps.Map{}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user