目标内容排序

master
Alan 6 months ago
parent 38d4960e88
commit b0a99cefdf
  1. 3
      src/main/java/com/teaching/backend/model/entity/courses/ObjectiveContents.java
  2. 2
      src/main/java/com/teaching/backend/service/impl/courses/CourseObjectivesServiceImpl.java

@ -36,5 +36,8 @@ public class ObjectiveContents implements Serializable {
@ApiModelProperty(value = "内容",required = true) @ApiModelProperty(value = "内容",required = true)
private String content; private String content;
@ApiModelProperty(value = "排序字段",required = true)
private Float orderNum;
} }

@ -202,7 +202,7 @@ public class CourseObjectivesServiceImpl extends ServiceImpl<CourseObjectivesMap
// 获取目标的内容列表 // 获取目标的内容列表
private List<ObjectiveContents> fetchContentsForObjective(String objectiveId) { private List<ObjectiveContents> fetchContentsForObjective(String objectiveId) {
LambdaQueryWrapper<ObjectiveContents> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ObjectiveContents> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ObjectiveContents::getObjectiveId, objectiveId); queryWrapper.eq(ObjectiveContents::getObjectiveId, objectiveId).orderByAsc(ObjectiveContents::getOrderNum);
List<ObjectiveContents> contents = objectiveContentsMapper.selectList(queryWrapper); List<ObjectiveContents> contents = objectiveContentsMapper.selectList(queryWrapper);
return contents; return contents;
} }

Loading…
Cancel
Save