refactor: 标准导图仅使用报告生成

This commit is contained in:
2026-08-03 23:08:19 +08:00
parent 5b6f7d6a2a
commit b434520eff
7 changed files with 42 additions and 75 deletions
@@ -1,6 +1,5 @@
package com.guo.learningprogresstracker.service.impl;
import com.guo.learningprogresstracker.entity.StudyReportFragmentsEntity;
import com.guo.learningprogresstracker.entity.StudyReportsEntity;
import com.guo.learningprogresstracker.entity.TaskApplicationEntity;
import com.guo.learningprogresstracker.entity.TaskEntity;
@@ -40,32 +39,26 @@ public class RemoteAiMindMapClient implements MindMapAiClient {
@Override
public Optional<MindMapNode> generate(TaskEntity task,
List<StudyReportsEntity> reports,
List<StudyReportFragmentsEntity> fragments,
List<TaskApplicationEntity> applications,
String clientHint) {
if (!isAvailable()) {
return Optional.empty();
}
// 提取报告和残片的内容文本
// 提取学习报告的内容文本
List<String> reportTexts = reports.stream()
.map(StudyReportsEntity::getContent)
.filter(c -> c != null && !c.isBlank())
.collect(Collectors.toList());
List<String> fragmentTexts = fragments.stream()
.map(StudyReportFragmentsEntity::getContent)
.filter(c -> c != null && !c.isBlank())
.collect(Collectors.toList());
if (reportTexts.isEmpty() && fragmentTexts.isEmpty()) {
if (reportTexts.isEmpty()) {
return Optional.empty();
}
Optional<String> optOutline = aiServiceClient.generateMindMap(
task.getTaskName(),
task.getTaskDescription(),
reportTexts,
fragmentTexts
reportTexts
);
if (optOutline.isEmpty() || optOutline.get().isBlank()) {