调整部分命名

This commit is contained in:
刘祥超
2021-09-14 19:39:41 +08:00
parent 8db6a33e15
commit 713de74abb
3 changed files with 7 additions and 7 deletions

View File

@@ -69,18 +69,18 @@ func UpdateNodeIPAddresses(parentAction *actionutils.ParentAction, nodeId int64,
}
// InitNodeIPAddressThresholds 初始化IP阈值
func InitNodeIPAddressThresholds(parentAction *actionutils.ParentAction, addrId int64) ([]*nodeconfigs.NodeValueThresholdConfig, error) {
func InitNodeIPAddressThresholds(parentAction *actionutils.ParentAction, addrId int64) ([]*nodeconfigs.IPAddressThresholdConfig, error) {
thresholdsResp, err := parentAction.RPC().NodeIPAddressThresholdRPC().FindAllEnabledNodeIPAddressThresholds(parentAction.AdminContext(), &pb.FindAllEnabledNodeIPAddressThresholdsRequest{NodeIPAddressId: addrId})
if err != nil {
return nil, err
}
var thresholds = []*nodeconfigs.NodeValueThresholdConfig{}
var thresholds = []*nodeconfigs.IPAddressThresholdConfig{}
if len(thresholdsResp.NodeIPAddressThresholds) > 0 {
for _, pbThreshold := range thresholdsResp.NodeIPAddressThresholds {
var threshold = &nodeconfigs.NodeValueThresholdConfig{
var threshold = &nodeconfigs.IPAddressThresholdConfig{
Id: pbThreshold.Id,
Items: []*nodeconfigs.NodeValueThresholdItemConfig{},
Actions: []*nodeconfigs.NodeValueThresholdActionConfig{},
Items: []*nodeconfigs.IPAddressThresholdItemConfig{},
Actions: []*nodeconfigs.IPAddressThresholdActionConfig{},
}
if len(pbThreshold.ItemsJSON) > 0 {
err = json.Unmarshal(pbThreshold.ItemsJSON, &threshold.Items)