优化代码

This commit is contained in:
刘祥超
2022-08-06 20:28:32 +08:00
parent 58a5bd0092
commit 14bafc8f20
22 changed files with 78 additions and 1455 deletions

View File

@@ -1 +1,20 @@
package nameservers
import (
"encoding/json"
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
)
func (this *NSDomain) DecodeGroupIds() []int64 {
if models.IsNull(this.GroupIds) {
return nil
}
var result = []int64{}
err := json.Unmarshal(this.GroupIds, &result)
if err != nil {
remotelogs.Error("NSDomain", "DecodeGroupIds:"+err.Error())
}
return result
}