From eb51dbe87f00ff30978fa627bfcf3015e852a992 Mon Sep 17 00:00:00 2001 From: guo <1716967236@qq.com> Date: Mon, 2 Jun 2025 21:25:00 +0800 Subject: [PATCH] =?UTF-8?q?[xingyu.guo]=20feat:=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=86=85=E5=AE=B9=201.=20taskDescription=202?= =?UTF-8?q?.=20lastLearningStatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/TaskInfoResponse.java | 8 +++++--- .../learningprogresstracker/entity/TaskEntity.java | 13 +++++++++++++ .../service/impl/TasksServiceImpl.java | 5 ++--- .../V20250602_1__addTaskDescribeForTasks.sql | 5 +++++ 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/db/migration/V20250602_1__addTaskDescribeForTasks.sql diff --git a/src/main/java/com/guo/learningprogresstracker/dto/response/TaskInfoResponse.java b/src/main/java/com/guo/learningprogresstracker/dto/response/TaskInfoResponse.java index 35a7099..e42f2f9 100644 --- a/src/main/java/com/guo/learningprogresstracker/dto/response/TaskInfoResponse.java +++ b/src/main/java/com/guo/learningprogresstracker/dto/response/TaskInfoResponse.java @@ -1,8 +1,5 @@ package com.guo.learningprogresstracker.dto.response; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; @Data @@ -54,4 +51,9 @@ public class TaskInfoResponse { */ private Double calculatedPriority; + /** + * 上次该任务学习情况 + */ + private String lastLearningStatus; + } diff --git a/src/main/java/com/guo/learningprogresstracker/entity/TaskEntity.java b/src/main/java/com/guo/learningprogresstracker/entity/TaskEntity.java index 0ebc041..c16f3b3 100644 --- a/src/main/java/com/guo/learningprogresstracker/entity/TaskEntity.java +++ b/src/main/java/com/guo/learningprogresstracker/entity/TaskEntity.java @@ -32,6 +32,13 @@ public class TaskEntity extends BaseEntity implements Serializable { @TableField(value = "task_name") private String taskName; + /** + * 任务描述 + */ + @TableField(value = "task_description") + private String taskDescription; + + /** * 学习材料的存储URL */ @@ -74,6 +81,12 @@ public class TaskEntity extends BaseEntity implements Serializable { @TableField(value = "calculated_priority") private Double calculatedPriority; + /** + * 上次该任务学习情况 todo 需要完善枚举 + */ + @TableField(value = "last_learning_status") + private String lastLearningStatus; + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/guo/learningprogresstracker/service/impl/TasksServiceImpl.java b/src/main/java/com/guo/learningprogresstracker/service/impl/TasksServiceImpl.java index b99d03f..0383ab5 100644 --- a/src/main/java/com/guo/learningprogresstracker/service/impl/TasksServiceImpl.java +++ b/src/main/java/com/guo/learningprogresstracker/service/impl/TasksServiceImpl.java @@ -39,13 +39,12 @@ public class TasksServiceImpl extends ServiceImpl private final TasksMapper tasksMapper; - private final TaskConvertImpl taskConvertImpl; @Override public Page taskList(Integer pageNum, Integer pageSize) { Page page = tasksMapper.selectPage(new Page(pageNum, pageSize), Wrappers.lambdaQuery(TaskEntity.class)); - //todo 补充返回内容 - Page response = taskConvertImpl.MAPPER.toTaskInfoPage(page); + Page response = TaskConvert.MAPPER.toTaskInfoPage(page); + return response; } diff --git a/src/main/resources/db/migration/V20250602_1__addTaskDescribeForTasks.sql b/src/main/resources/db/migration/V20250602_1__addTaskDescribeForTasks.sql new file mode 100644 index 0000000..13efffb --- /dev/null +++ b/src/main/resources/db/migration/V20250602_1__addTaskDescribeForTasks.sql @@ -0,0 +1,5 @@ +ALTER TABLE tasks + ADD task_description text null COMMENT '任务描述' after task_name; + +ALTER TABLE tasks + ADD last_learning_status varchar(30) null COMMENT '上次该任务学习情况' after calculated_priority; \ No newline at end of file