[xingyu.guo] feat: 补充返回内容 1. taskDescription 2. lastLearningStatus

This commit is contained in:
guo
2025-06-02 21:25:00 +08:00
parent 82e16d9cac
commit eb51dbe87f
4 changed files with 25 additions and 6 deletions
@@ -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;
}
@@ -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;
}
@@ -39,13 +39,12 @@ public class TasksServiceImpl extends ServiceImpl<TasksMapper, TaskEntity>
private final TasksMapper tasksMapper;
private final TaskConvertImpl taskConvertImpl;
@Override
public Page<TaskInfo> taskList(Integer pageNum, Integer pageSize) {
Page<TaskEntity> page = tasksMapper.selectPage(new Page<TaskEntity>(pageNum, pageSize), Wrappers.lambdaQuery(TaskEntity.class));
//todo 补充返回内容
Page<TaskInfo> response = taskConvertImpl.MAPPER.toTaskInfoPage(page);
Page<TaskInfo> response = TaskConvert.MAPPER.toTaskInfoPage(page);
return response;
}
@@ -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;