课程、章节评论

This commit is contained in:
wuchunlei
2024-06-12 16:38:34 +08:00
parent 501db3f59d
commit 85901e1996
9 changed files with 230 additions and 1 deletions

View File

@@ -114,11 +114,14 @@ public class CourseController {
courseCatalogueChapterService.updateById(courseCatalogueChapterEntity);
//修改视频
if (courseCatalogueChapterEntity.getVideoList()!=null&&courseCatalogueChapterEntity.getVideoList().size() > 0){
LambdaQueryWrapper<CourseCatalogueChapterVideoEntity> wrapper = new LambdaQueryWrapper();
wrapper.eq(CourseCatalogueChapterVideoEntity::getChapterId,courseCatalogueChapterEntity.getId());
courseCatalogueChapterVideoService.remove(wrapper);
for (CourseCatalogueChapterVideoEntity c:courseCatalogueChapterEntity.getVideoList()) {
if (c.getId()==0){
courseCatalogueChapterVideoService.save(c);
}else {
courseCatalogueChapterVideoService.updateById(c);
courseCatalogueChapterVideoService.saveOrUpdate(c);
}
}
}