feat: 报告作为思维导图生成的参考上下文

This commit is contained in:
2026-10-22 21:58:50 +08:00
parent 6075839937
commit 13e12ba4da
23 changed files with 656 additions and 63 deletions
@@ -3,6 +3,7 @@ package com.guo.learningprogresstracker.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.guo.learningprogresstracker.dto.MindMapReportContext;
import com.guo.learningprogresstracker.dto.RecallCompareOutcome;
import com.guo.learningprogresstracker.dto.ReviewTiming;
import com.guo.learningprogresstracker.entity.*;
@@ -40,6 +41,7 @@ public class StandardMindMapServiceImpl implements StandardMindMapService {
private final StudyReportFragmentsMapper studyReportFragmentsMapper;
private final MindMapOutlineGenerator outlineGenerator;
private final MindMapReportContextLoader reportContextLoader;
private final ObjectMapper objectMapper;
private final AiServiceClient aiServiceClient;
@@ -439,8 +441,11 @@ public class StandardMindMapServiceImpl implements StandardMindMapService {
throw new OperationFailedException("这个任务还没开始学习哦,学习后产生知识碎片后再来吧");
}
// 「碎片 → 缩进大纲」生成链路(AI 优先、内置规则降级)与标签导图共用同一套口径
MindMapOutlineGenerator.GeneratedOutline generated = outlineGenerator.generate(task, fragments, applications);
// 「碎片 → 缩进大纲」生成链路(AI 优先、内置规则降级)与标签导图共用同一套口径;
// 报告-02:把碎片同源会话的报告作为参考上下文带上,让 AI 提取总结里由碎片拼接出的新定义/观点
List<MindMapReportContext> reports = reportContextLoader.load(fragments);
MindMapOutlineGenerator.GeneratedOutline generated =
outlineGenerator.generate(task, fragments, applications, reports);
MindMapNode root = generated.root();
String contentJson = MindMapTreeTool.toJson(root, objectMapper);