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