zhou zhou
昨天 d5884d0974d17d96225a5d80e432de33a5ee6552
rsf-server/src/main/java/com/vincent/rsf/server/ai/controller/AiChatController.java
@@ -57,6 +57,20 @@
    }
    @PreAuthorize("isAuthenticated()")
    @PostMapping("/ai/chat/session/memory/clear/{sessionId}")
    public R clearSessionMemory(@PathVariable Long sessionId) {
        aiChatService.clearSessionMemory(sessionId, getLoginUserId(), getTenantId());
        return R.ok("Clear Success").add(sessionId);
    }
    @PreAuthorize("isAuthenticated()")
    @PostMapping("/ai/chat/session/memory/retain-latest/{sessionId}")
    public R retainLatestRound(@PathVariable Long sessionId) {
        aiChatService.retainLatestRound(sessionId, getLoginUserId(), getTenantId());
        return R.ok("Retain Success").add(sessionId);
    }
    @PreAuthorize("isAuthenticated()")
    @PostMapping(value = "/ai/chat/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public SseEmitter stream(@RequestBody AiChatRequest request) {
        String requestId = StringUtils.hasText(request.getRequestId())