Skip to content

Commit 7d00e68

Browse files
committed
add ChatMemoryController for quick test
1 parent 6947c6d commit 7d00e68

File tree

1 file changed

+32
-0
lines changed
  • spring-ai-chat-memory/spring-ai-chat-memory-local/src/main/java/com/glmapper/ai/chat/memory/local/controller

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.glmapper.ai.chat.memory.local.controller;
2+
3+
import com.glmapper.ai.chat.memory.local.service.ChatMemoryService;
4+
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.web.bind.annotation.RequestMapping;
6+
import org.springframework.web.bind.annotation.RestController;
7+
8+
/**
9+
* @Classname TestController
10+
* @Description
11+
* <p>
12+
* # 你好,我是glmapper
13+
* 1、curl -X GET http://localhost:8083/api/test/chat?message=%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%88%91%E6%98%AFglmapper&conversationId=test-1101
14+
* # 我是谁?
15+
* 2、curl -X GET http://localhost:8083/api/test/chat?message=%E6%88%91%E6%98%AF%E8%B0%81%EF%BC%9F&conversationId=test-1101
16+
*
17+
* </p>
18+
* @Date 2025/6/14 17:36
19+
* @Created by glmapper
20+
*/
21+
@RestController
22+
@RequestMapping("/api/test")
23+
public class ChatMemoryController {
24+
25+
@Autowired
26+
private ChatMemoryService chatMemoryService;
27+
28+
@RequestMapping("chat")
29+
public String test(String message, String conversationId) {
30+
return this.chatMemoryService.chat(message, conversationId);
31+
}
32+
}

0 commit comments

Comments
 (0)