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; }