mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-13 15:30:24 +08:00
对服务增加基础的数据统计/部分代码分Package
This commit is contained in:
20
internal/db/models/acme/acme_task_model_ext.go
Normal file
20
internal/db/models/acme/acme_task_model_ext.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package acme
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
)
|
||||
|
||||
// 将域名解析成字符串数组
|
||||
func (this *ACMETask) DecodeDomains() []string {
|
||||
if len(this.Domains) == 0 || this.Domains == "null" {
|
||||
return nil
|
||||
}
|
||||
result := []string{}
|
||||
err := json.Unmarshal([]byte(this.Domains), &result)
|
||||
if err != nil {
|
||||
logs.Error(err)
|
||||
return nil
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user