2021-09-05 11:10:18 +08:00
|
|
|
package models
|
|
|
|
|
|
2021-09-08 19:34:31 +08:00
|
|
|
import (
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
|
|
|
|
)
|
2021-09-05 11:10:18 +08:00
|
|
|
|
|
|
|
|
func (this *ReportNode) DecodeAllowIPs() []string {
|
|
|
|
|
var result = []string{}
|
|
|
|
|
if len(this.AllowIPs) > 0 {
|
2021-09-08 19:34:31 +08:00
|
|
|
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())
|
|
|
|
|
}
|
2021-09-05 11:10:18 +08:00
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|