This commit is contained in:
wuchunlei
2024-03-25 17:46:48 +08:00
12 changed files with 226 additions and 14 deletions

View File

@@ -2,9 +2,14 @@ package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peanut.common.utils.R;
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
import com.peanut.modules.common.entity.CourseCatalogueEntity;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.master.service.CourseCatalogueChapterService;
import com.peanut.modules.master.service.CourseCatalogueChapterVideoService;
import com.peanut.modules.master.service.CourseCatalogueService;
import com.peanut.modules.master.service.CourseService;
import lombok.extern.slf4j.Slf4j;
@@ -25,6 +30,10 @@ public class CourseController {
private CourseService courseService;
@Autowired
private CourseCatalogueService courseCatalogueService;
@Autowired
private CourseCatalogueChapterService courseCatalogueChapterService;
@Autowired
private CourseCatalogueChapterVideoService courseCatalogueChapterVideoService;
@RequestMapping("/getCourseList")
@@ -56,12 +65,9 @@ public class CourseController {
return R.ok().put("catalogues",courseCatalogues);
}
@RequestMapping("/addCourseCatalogue")
public R addCourseCatalogue(@RequestBody CourseCatalogueEntity courseCatalogue){
//课程这里增加对应商品的还没有做
courseCatalogueService.save(courseCatalogue);
courseCatalogueService.addCourseCatalogue(courseCatalogue);
return R.ok();
}
@@ -70,4 +76,57 @@ public class CourseController {
return courseCatalogueService.delCourseCatalogue(param.getId());
}
@RequestMapping("/editCourseCatalogue")
public R editCourseCatalogue(@RequestBody CourseCatalogueEntity c){
courseCatalogueService.updateById(c);
return R.ok();
}
@RequestMapping("/getCourseCatalogueChapterList")
public R getCourseCatalogueChapterList(@RequestBody ParamTo param){
Page courseCatalogueChapterList = courseCatalogueChapterService.getCourseCatalogueChapterList(param);
return R.ok().put("page",courseCatalogueChapterList);
}
@RequestMapping("/addCourseCatalogueChapter")
public R addCourseCatalogueChapter(@RequestBody CourseCatalogueChapterEntity courseCatalogueChapterEntity){
courseCatalogueChapterService.save(courseCatalogueChapterEntity);
return R.ok();
}
@RequestMapping("/delCourseCatalogueChapter")
public R delCourseCatalogueChapter(@RequestBody ParamTo param){
return courseCatalogueChapterService.delCourseCatalogueChapter(param.getId());
}
@RequestMapping("/editCourseCatalogueChapter")
public R editCourseCatalogueChapter(@RequestBody CourseCatalogueChapterEntity courseCatalogueChapterEntity){
courseCatalogueChapterService.updateById(courseCatalogueChapterEntity);
return R.ok();
}
@RequestMapping("/getCourseCatalogueChapterVideoList")
public R getCourseCatalogueChapterVideoList(@RequestBody ParamTo param){
courseCatalogueChapterVideoService.getCourseCatalogueChapterVideoList(param);
return R.ok();
}
@RequestMapping("/addCourseCatalogueChapterVideo")
public R addCourseCatalogueChapterVideo(@RequestBody CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity){
courseCatalogueChapterVideoService.save(courseCatalogueChapterVideoEntity);
return R.ok();
}
@RequestMapping("/delCourseCatalogueChapterVideo")
public R delCourseCatalogueChapterVideo(@RequestBody ParamTo param){
courseCatalogueChapterVideoService.removeById(param.getId());
return R.ok();
}
@RequestMapping("/editCourseCatalogueChapterVideo")
public R editCourseCatalogueChapterVideo(@RequestBody CourseCatalogueChapterVideoEntity courseCatalogueChapterVideoEntity){
courseCatalogueChapterVideoService.updateById(courseCatalogueChapterVideoEntity);
return R.ok();
}
}