feat(service): 新增 WebSocket 实时语音转写与流式 TTS 全流程

This commit is contained in:
2026-01-23 14:25:05 +08:00
parent 8632dcd282
commit bb3dcc56ff
6 changed files with 79 additions and 1 deletions

View File

@@ -45,6 +45,20 @@ public class ChatController {
private ChatService chatService;
@PostMapping("/message")
@Operation(summary = "同步对话", description = "发送消息给大模型,同步返回回复")
public BaseResponse<String> message(@RequestParam("content") String content) {
if (StrUtil.isBlank(content)) {
throw new BusinessException(ErrorCode.PARAMS_ERROR, "消息内容不能为空");
}
String userId = StpUtil.getLoginIdAsString();
String response = chatService.message(content, userId);
return ResultUtils.success(response);
}
@PostMapping("/talk")
@Operation(summary = "聊天润色接口", description = "聊天润色接口")
public Flux<ServerSentEvent<ChatStreamMessage>> talk(@RequestBody ChatReq chatReq){