From 9897dd9551312f6b4e4b2362677c89c633d40e59 Mon Sep 17 00:00:00 2001 From: wenjinbo <599483010@qq.com> Date: Tue, 30 Sep 2025 09:44:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=AD=E9=9F=B3=E8=BD=AC=E6=96=87?= =?UTF-8?q?=E5=AD=97=E6=8E=A5=E5=8F=A3=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bjtds/brichat/controller/ChatController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chat-server/src/main/java/com/bjtds/brichat/controller/ChatController.java b/chat-server/src/main/java/com/bjtds/brichat/controller/ChatController.java index 618426b..18b1d30 100644 --- a/chat-server/src/main/java/com/bjtds/brichat/controller/ChatController.java +++ b/chat-server/src/main/java/com/bjtds/brichat/controller/ChatController.java @@ -3,6 +3,7 @@ package com.bjtds.brichat.controller; import com.bjtds.brichat.entity.chat.ChatMessageSendReq; import com.bjtds.brichat.service.ChatService; +import com.bjtds.brichat.util.ResultUtils; import io.github.guoshiqiufeng.dify.chat.dto.request.ChatMessageSendRequest; import io.github.guoshiqiufeng.dify.chat.dto.response.ChatMessageSendCompletionResponse; import io.swagger.annotations.Api; @@ -74,7 +75,7 @@ public class ChatController { * @return 转换后的文字 */ @PostMapping("/voiceToText") - public String voiceToText(@RequestParam("file") MultipartFile file){ + public ResultUtils voiceToText(@RequestParam("file") MultipartFile file){ try { log.info("开始语音转文字,文件名: {}, 文件大小: {} bytes", file.getOriginalFilename(), file.getSize()); @@ -111,7 +112,7 @@ public class ChatController { Map responseBody = response.getBody(); String text = (String) responseBody.get("text"); log.info("语音转文字成功,结果: {}", text); - return text; + return ResultUtils.success(text); } else { log.error("语音转文字失败,响应状态: {}, 响应体: {}", response.getStatusCode(), response.getBody());