From b0a99cefdfce8adeb2b896c7481da1b7f3c392bd Mon Sep 17 00:00:00 2001 From: Alan <3052806735@qq.com> Date: Mon, 29 Jul 2024 20:47:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E6=A0=87=E5=86=85=E5=AE=B9=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/model/entity/courses/ObjectiveContents.java | 3 +++ .../service/impl/courses/CourseObjectivesServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContents.java b/src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContents.java index 4dc89f6..8ccd7ef 100644 --- a/src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContents.java +++ b/src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContents.java @@ -36,5 +36,8 @@ public class ObjectiveContents implements Serializable { @ApiModelProperty(value = "内容",required = true) private String content; + @ApiModelProperty(value = "排序字段",required = true) + private Float orderNum; + } diff --git a/src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java index 0272eb0..1ebffa2 100644 --- a/src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java @@ -202,7 +202,7 @@ public class CourseObjectivesServiceImpl extends ServiceImpl fetchContentsForObjective(String objectiveId) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(ObjectiveContents::getObjectiveId, objectiveId); + queryWrapper.eq(ObjectiveContents::getObjectiveId, objectiveId).orderByAsc(ObjectiveContents::getOrderNum); List contents = objectiveContentsMapper.selectList(queryWrapper); return contents; }