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());