|
@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import jakarta.annotation.security.PermitAll;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -37,6 +38,7 @@ public class AiChatMessageController {
|
|
|
// TODO @fan:要不要使用 Flux 来返回;可以使用 Flux<AiChatMessageRespVO>
|
|
|
@Operation(summary = "发送消息(流式)", description = "流式返回,响应较快")
|
|
|
@PostMapping(value = "/send-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
|
+ @PermitAll // 解决 SSE 最终响应的时候,会被 Access Denied 拦截的问题
|
|
|
public Flux<AiChatMessageRespVO> sendMessageStream(@Validated @RequestBody AiChatMessageSendStreamReqVO sendReqVO) {
|
|
|
return chatService.chatStream(sendReqVO);
|
|
|
}
|