This commit is contained in:
2026-07-25 14:18:14 +08:00
parent cc2513652e
commit fa55098520
7 changed files with 216 additions and 58 deletions

View File

@@ -1,6 +1,8 @@
package yuyuecha
import (
"path/filepath"
"tyapi-server/internal/config"
"tyapi-server/internal/shared/external_logger"
)
@@ -38,12 +40,18 @@ func NewYuyuechaServiceWithConfig(cfg *config.Config) (*YuyuechaService, error)
timeout = cfg.Yuyuecha.Timeout
}
logDir := cfg.Yuyuecha.Logging.LogDir
if logDir == "" {
logDir = "logs/external_services"
}
serviceCfg := ServiceConfig{
BaseURL: cfg.Yuyuecha.BaseURL,
ClientID: cfg.Yuyuecha.ClientID,
ClientSecret: cfg.Yuyuecha.ClientSecret,
Timeout: timeout,
Debug: cfg.App.IsDevelopment(),
DebugLogDir: filepath.Join(logDir, "yuyuecha"),
}
return NewYuyuechaService(serviceCfg, logger), nil