This commit is contained in:
wuchunlei
2024-04-03 09:09:28 +08:00
3 changed files with 7 additions and 5 deletions

View File

@@ -21,6 +21,8 @@ public class CourseEntity {
private String title;
private Integer sort;
private Date createTime;
@TableLogic

View File

@@ -107,14 +107,14 @@ public class CourseController {
@RequestMapping("/getCourseCatalogueChapterVideoList")
public R getCourseCatalogueChapterVideoList(@RequestBody ParamTo param){
courseCatalogueChapterVideoService.getCourseCatalogueChapterVideoList(param);
return R.ok();
Page courseCatalogueChapterVideoList = courseCatalogueChapterVideoService.getCourseCatalogueChapterVideoList(param);
return R.ok().put("page",courseCatalogueChapterVideoList);
}
@RequestMapping("/addCourseCatalogueChapterVideo")
public R addCourseCatalogueChapterVideo(@RequestBody CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity){
courseCatalogueChapterVideoService.save(courseCatalogueChapterVideoEntity);
return R.ok();
boolean save = courseCatalogueChapterVideoService.save(courseCatalogueChapterVideoEntity);
return save?R.ok():R.error("error");
}
@RequestMapping("/delCourseCatalogueChapterVideo")

View File

@@ -74,7 +74,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
if(ObjectUtils.isNotBlank(map,"keywords")){
wrapper.like(CourseEntity::getTitle,map.get("keywords").toString());
}
wrapper.orderByAsc(CourseEntity::getSort);
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (CourseEntity c:courseEntityPage.getRecords()){
List<CourseCatalogueEntity> courseCatalogueEntities = courseCatalogueDao.selectList(new LambdaQueryWrapper<CourseCatalogueEntity>().eq(CourseCatalogueEntity::getCourseId, c.getId()).orderByAsc(CourseCatalogueEntity::getSort));