|
@@ -40,18 +40,12 @@ public class SseController {
|
|
|
return sseEmitter;
|
|
|
}
|
|
|
|
|
|
- @Resource
|
|
|
- private KimiChatServiceImpl kimiChatService;
|
|
|
-
|
|
|
- @PostMapping(path = "/chat", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
|
+ @GetMapping(path = "/chat", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
|
@NoAPIResponse
|
|
|
- public SseEmitter handleSsePost(@RequestBody KimiChat kimiChat) throws IOException {
|
|
|
+ public SseEmitter handleSsePost(@RequestParam("token") String token,
|
|
|
+ @RequestParam("groupId") Long gid) throws IOException {
|
|
|
SseEmitter sseEmitter = new SseEmitter(0L); // 设置超时时间
|
|
|
- sseService.monitor(kimiChat.getGroupId(), sseEmitter);
|
|
|
- poolExecutor.execute(() -> {
|
|
|
- kimiChatService.create(kimiChat);
|
|
|
- });
|
|
|
- sseEmitter.send(SseEmitter.event().name("hello").data("你好"));
|
|
|
+ sseService.monitor(gid, sseEmitter);
|
|
|
sseEmitter.send(SseEmitter.event().name("hello").data("hello"));
|
|
|
return sseEmitter;
|
|
|
}
|