|
@@ -36,7 +36,8 @@ public class AiSessionController {
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
return getSessionsByUserId(userId);
|
|
|
}
|
|
|
- public List<AiSession> getSessionsByUserId(@PathVariable Long userId) {
|
|
|
+
|
|
|
+ public List<AiSession> getSessionsByUserId(Long userId) {
|
|
|
List<AiSession> sessions = aiSessionMapper.findByUserId(userId);
|
|
|
|
|
|
for (AiSession session : sessions) {
|
|
@@ -50,15 +51,19 @@ public class AiSessionController {
|
|
|
userItem.setUserId(question.getUserId());
|
|
|
userItem.setUserName(question.getUserName());
|
|
|
userItem.setAskTime(question.getAskTime());
|
|
|
+ // 不设置 reasoningContent,因为 role 是 user
|
|
|
+
|
|
|
+ itemList.add(userItem);
|
|
|
|
|
|
- AiQuestionItem assistantItem = new AiQuestionItem("assistant", question.getAnswer());
|
|
|
+ AiQuestionItem assistantItem = new AiQuestionItem("assistant", null); // 初始化 content 为 null
|
|
|
assistantItem.setId(question.getId());
|
|
|
assistantItem.setSessionId(question.getSessionId());
|
|
|
assistantItem.setUserId(question.getUserId());
|
|
|
assistantItem.setUserName(question.getUserName());
|
|
|
assistantItem.setAskTime(question.getAskTime());
|
|
|
+ assistantItem.setReasoningContent(question.getAnswer()); // 设置 reasoningContent
|
|
|
+ // 不设置 content,因为 role 是 assistant
|
|
|
|
|
|
- itemList.add(userItem);
|
|
|
itemList.add(assistantItem);
|
|
|
}
|
|
|
|