Files
EdgeAPI/internal/db/models/node_cluster_firewall_action_model_ext.go

21 lines
369 B
Go
Raw Normal View History

2021-02-06 17:38:04 +08:00
package models
import (
"encoding/json"
2024-07-27 14:15:25 +08:00
2021-02-06 17:38:04 +08:00
"github.com/iwind/TeaGo/maps"
)
2022-03-22 19:30:30 +08:00
// DecodeParams 解析参数
2021-02-06 17:38:04 +08:00
func (this *NodeClusterFirewallAction) DecodeParams() (maps.Map, error) {
if IsNotNull(this.Params) {
params := maps.Map{}
2022-03-22 19:30:30 +08:00
err := json.Unmarshal(this.Params, &params)
2021-02-06 17:38:04 +08:00
if err != nil {
return nil, err
}
return params, nil
}
return maps.Map{}, nil
}