mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-14 08:20:25 +08:00
节点IP地址可以设置阈值
This commit is contained in:
@@ -1 +1,20 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
)
|
||||
|
||||
func (this *NodeIPAddress) DecodeThresholds() []*nodeconfigs.NodeValueThresholdConfig {
|
||||
var result = []*nodeconfigs.NodeValueThresholdConfig{}
|
||||
if len(this.Thresholds) == 0 {
|
||||
return result
|
||||
}
|
||||
err := json.Unmarshal([]byte(this.Thresholds), &result)
|
||||
if err != nil {
|
||||
// 不处理错误
|
||||
logs.Error(err)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user