mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-29 03:20:24 +08:00
实现基本的监控终端管理
This commit is contained in:
@@ -1,12 +1,28 @@
|
||||
package models
|
||||
|
||||
import "encoding/json"
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
)
|
||||
|
||||
func (this *ReportNode) DecodeAllowIPs() []string {
|
||||
var result = []string{}
|
||||
if len(this.AllowIPs) > 0 {
|
||||
// 忽略错误
|
||||
_ = json.Unmarshal([]byte(this.AllowIPs), &result)
|
||||
err := json.Unmarshal([]byte(this.AllowIPs), &result)
|
||||
if err != nil {
|
||||
remotelogs.Error("ReportNode.DecodeGroupIds", err.Error())
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (this *ReportNode) DecodeGroupIds() []int64 {
|
||||
var result = []int64{}
|
||||
if len(this.GroupIds) > 0 {
|
||||
err := json.Unmarshal([]byte(this.GroupIds), &result)
|
||||
if err != nil {
|
||||
remotelogs.Error("ReportNode.DecodeGroupIds", err.Error())
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user