重构项目

This commit is contained in:
2025-10-30 18:26:02 +08:00
parent fbc8bcd089
commit 7e10e2d2da
39 changed files with 728 additions and 464 deletions

View File

@ -0,0 +1,22 @@
package Func
import (
"SafelineAPI/internal/app/SafelineRequest"
"SafelineAPI/internal/app/logger"
"SafelineAPI/internal/class/config"
"SafelineAPI/internal/moudle"
"SafelineAPI/pkg/utils"
"log"
)
func UpdateCertCheck(conf config.Config) ([]SafelineRequest.Nodes, bool) {
certNodes := utils.GetList(conf.Server.Host.Url(), conf.Server.ApiToken.String())
certUpsert := moudle.CheckNodes(certNodes, conf.Days)
if len(certUpsert) != 0 {
log.Printf("本次需要更新证书数量有 %s%d%s 个,现在开始更新...", logger.Yellow, len(certUpsert), logger.Reset)
} else {
log.Print("本次无需更新证书,即将退出本程序。")
return nil, true
}
return certUpsert, false
}