feat: 学习材料地址(materialUrl)支持
- TaskInfo DTO 新增 materialUrl 字段 - StudySessionResponse 新增 materialUrl 和 taskId 字段 - StudySessionsServiceImpl 在学习会话响应中填充 materialUrl 和 taskId - TasksServiceImpl 更新任务时保留原有 taskNum - 修复 TaskInfoResponse 注释格式错误
This commit is contained in:
@@ -13,6 +13,8 @@ public class TaskInfo {
|
||||
private String taskName;
|
||||
// 任务描述
|
||||
private String taskDescription;
|
||||
// 学习材料地址
|
||||
private String materialUrl;
|
||||
// 任务优先级
|
||||
private Double taskPriority;
|
||||
// 上次该任务学习情况
|
||||
|
||||
@@ -17,6 +17,12 @@ public class StudySessionResponse {
|
||||
@Schema(description = "任务编号")
|
||||
private String taskNum;
|
||||
|
||||
@Schema(description = "学习材料(Markdown)")
|
||||
private String materialUrl;
|
||||
|
||||
@Schema(description = "任务ID")
|
||||
private Integer taskId;
|
||||
|
||||
@Schema(description = "学习开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public class TaskInfoResponse {
|
||||
*/
|
||||
private String materialUrl;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 用户设置的任务紧急性
|
||||
*/
|
||||
|
||||
+2
@@ -73,6 +73,8 @@ public class StudySessionsServiceImpl extends ServiceImpl<StudySessionsMapper, S
|
||||
|
||||
StudySessionResponse response = StudySessionConvert.MAPPER.toStudySessionResponse(session);
|
||||
response.setTaskName(taskEntity.getTaskName());
|
||||
response.setMaterialUrl(taskEntity.getMaterialUrl());
|
||||
response.setTaskId(taskEntity.getId());
|
||||
|
||||
if (session.isOverTime()) {
|
||||
response.setSystemMessage("上段学习任务已经超时25分钟,将仅计算为25分钟的有效学习时间,请注意休息!");
|
||||
|
||||
@@ -90,6 +90,7 @@ public class TasksServiceImpl extends ServiceImpl<TasksMapper, TaskEntity>
|
||||
throw new IllegalArgumentException("任务ID格式错误: " + taskId);
|
||||
}
|
||||
taskEntity.setId(id);
|
||||
taskEntity.setTaskNum(existingTask.getTaskNum());
|
||||
// 维度数据可能变化,更新时重算优先级
|
||||
PriorityDto priorityDto = RequestConvert.MAPPER.taskRequestToPriorityDto(updatedTask);
|
||||
taskEntity.setCalculatedPriority(CalculatedPriorityTool.calculatedPriority(priorityDto, priorityWeightsService.getWeights()));
|
||||
|
||||
Reference in New Issue
Block a user