From c56b27aeeeb66d440bb7e3d87b90a55b11c04cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=94=A6=E5=BC=BA?= <1061669148@qq.com> Date: Mon, 10 Mar 2025 08:39:42 +0800 Subject: [PATCH] feat: remove unused HandleOpenAITTS function and adjust token expiry time --- internal/http/handlers/tts.go | 1 - internal/tts/microsoft/client.go | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/http/handlers/tts.go b/internal/http/handlers/tts.go index c51dcf9..26b4350 100644 --- a/internal/http/handlers/tts.go +++ b/internal/http/handlers/tts.go @@ -221,7 +221,6 @@ func (h *TTSHandler) HandleTTS(w http.ResponseWriter, r *http.Request) { return } - // 非流式模式处理(保持原有逻辑) synthStart := time.Now() resp, err := h.ttsService.SynthesizeSpeech(r.Context(), req) synthTime := time.Since(synthStart) diff --git a/internal/tts/microsoft/client.go b/internal/tts/microsoft/client.go index c41fb2c..b6f30e8 100644 --- a/internal/tts/microsoft/client.go +++ b/internal/tts/microsoft/client.go @@ -52,11 +52,6 @@ type Client struct { endpointExpiry time.Time } -func (c *Client) HandleOpenAITTS(w http.ResponseWriter, r *http.Request) { - //TODO implement me - panic("implement me") -} - // NewClient 创建一个新的Microsoft TTS客户端 func NewClient(cfg *config.Config) *Client { client := &Client{ @@ -94,7 +89,7 @@ func (c *Client) getEndpoint(ctx context.Context) (map[string]interface{}, error // 更新缓存 c.endpointMu.Lock() c.endpoint = endpoint - c.endpointExpiry = time.Now().Add(45 * time.Minute) // 令牌有效期通常是1小时,提前刷新 + c.endpointExpiry = time.Now().Add(30 * time.Minute) // 令牌有效期通常是1小时,提前刷新 c.endpointMu.Unlock() return endpoint, nil