diff --git a/internal/db/models/node_ip_address_threshold_dao.go b/internal/db/models/node_ip_address_threshold_dao.go index ba258a6a..4b67a487 100644 --- a/internal/db/models/node_ip_address_threshold_dao.go +++ b/internal/db/models/node_ip_address_threshold_dao.go @@ -115,7 +115,7 @@ func (this *NodeIPAddressThresholdDAO) UpdateThresholdNotifiedAt(tx *dbs.Tx, thr } // CreateThreshold 创建阈值 -func (this *NodeIPAddressThresholdDAO) CreateThreshold(tx *dbs.Tx, addressId int64, items []*nodeconfigs.NodeValueThresholdItemConfig, actions []*nodeconfigs.NodeValueThresholdActionConfig, order int) (int64, error) { +func (this *NodeIPAddressThresholdDAO) CreateThreshold(tx *dbs.Tx, addressId int64, items []*nodeconfigs.IPAddressThresholdItemConfig, actions []*nodeconfigs.IPAddressThresholdActionConfig, order int) (int64, error) { if addressId <= 0 { return 0, errors.New("invalid addressId") } @@ -148,7 +148,7 @@ func (this *NodeIPAddressThresholdDAO) CreateThreshold(tx *dbs.Tx, addressId int } // UpdateThreshold 修改阈值 -func (this *NodeIPAddressThresholdDAO) UpdateThreshold(tx *dbs.Tx, thresholdId int64, items []*nodeconfigs.NodeValueThresholdItemConfig, actions []*nodeconfigs.NodeValueThresholdActionConfig, order int) error { +func (this *NodeIPAddressThresholdDAO) UpdateThreshold(tx *dbs.Tx, thresholdId int64, items []*nodeconfigs.IPAddressThresholdItemConfig, actions []*nodeconfigs.IPAddressThresholdActionConfig, order int) error { if thresholdId <= 0 { return errors.New("invalid thresholdId") } diff --git a/internal/db/models/node_ip_address_threshold_model_ext.go b/internal/db/models/node_ip_address_threshold_model_ext.go index 8e117075..d2f9cf03 100644 --- a/internal/db/models/node_ip_address_threshold_model_ext.go +++ b/internal/db/models/node_ip_address_threshold_model_ext.go @@ -6,7 +6,7 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" ) -func (this *NodeIPAddressThreshold) DecodeItems() (result []*nodeconfigs.NodeValueThresholdItemConfig) { +func (this *NodeIPAddressThreshold) DecodeItems() (result []*nodeconfigs.IPAddressThresholdItemConfig) { if len(this.Items) == 0 { return } @@ -18,7 +18,7 @@ func (this *NodeIPAddressThreshold) DecodeItems() (result []*nodeconfigs.NodeVal return } -func (this *NodeIPAddressThreshold) DecodeActions() (result []*nodeconfigs.NodeValueThresholdActionConfig) { +func (this *NodeIPAddressThreshold) DecodeActions() (result []*nodeconfigs.IPAddressThresholdActionConfig) { if len(this.Actions) == 0 { return } diff --git a/internal/rpc/services/service_node_ip_address_threshold.go b/internal/rpc/services/service_node_ip_address_threshold.go index e24d9c11..ae2cbf64 100644 --- a/internal/rpc/services/service_node_ip_address_threshold.go +++ b/internal/rpc/services/service_node_ip_address_threshold.go @@ -24,7 +24,7 @@ func (this *NodeIPAddressThresholdService) CreateNodeIPAddressThreshold(ctx cont } var tx = this.NullTx() - var items = []*nodeconfigs.NodeValueThresholdItemConfig{} + var items = []*nodeconfigs.IPAddressThresholdItemConfig{} if len(req.ItemsJSON) > 0 { err = json.Unmarshal(req.ItemsJSON, &items) if err != nil { @@ -32,7 +32,7 @@ func (this *NodeIPAddressThresholdService) CreateNodeIPAddressThreshold(ctx cont } } - var actions = []*nodeconfigs.NodeValueThresholdActionConfig{} + var actions = []*nodeconfigs.IPAddressThresholdActionConfig{} if len(req.ActionsJSON) > 0 { err = json.Unmarshal(req.ActionsJSON, &actions) if err != nil { @@ -55,7 +55,7 @@ func (this *NodeIPAddressThresholdService) UpdateNodeIPAddressThreshold(ctx cont } var tx = this.NullTx() - var items = []*nodeconfigs.NodeValueThresholdItemConfig{} + var items = []*nodeconfigs.IPAddressThresholdItemConfig{} if len(req.ItemsJSON) > 0 { err = json.Unmarshal(req.ItemsJSON, &items) if err != nil { @@ -63,7 +63,7 @@ func (this *NodeIPAddressThresholdService) UpdateNodeIPAddressThreshold(ctx cont } } - var actions = []*nodeconfigs.NodeValueThresholdActionConfig{} + var actions = []*nodeconfigs.IPAddressThresholdActionConfig{} if len(req.ActionsJSON) > 0 { err = json.Unmarshal(req.ActionsJSON, &actions) if err != nil { @@ -140,7 +140,7 @@ func (this *NodeIPAddressThresholdService) UpdateAllNodeIPAddressThresholds(ctx var tx = this.NullTx() - var thresholds = []*nodeconfigs.NodeValueThresholdConfig{} + var thresholds = []*nodeconfigs.IPAddressThresholdConfig{} err = json.Unmarshal(req.NodeIPAddressThresholdsJSON, &thresholds) if err != nil { return nil, errors.New("decode thresholds failed: " + err.Error())