|
|
@ -74,6 +74,7 @@ public class CourseController {
|
|
|
|
list.add(Constant.BUILT_IN_SCHOOL_ID);
|
|
|
|
list.add(Constant.BUILT_IN_SCHOOL_ID);
|
|
|
|
criteria.andSchoolIdIn(list);
|
|
|
|
criteria.andSchoolIdIn(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
example.setOrderByClause("sequence asc");
|
|
|
|
List<SysCourse> courseList = courseMapper.selectByExample(example);
|
|
|
|
List<SysCourse> courseList = courseMapper.selectByExample(example);
|
|
|
|
return new ResultEntity(HttpStatus.OK,"展示成功",courseList);
|
|
|
|
return new ResultEntity(HttpStatus.OK,"展示成功",courseList);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -85,6 +86,7 @@ public class CourseController {
|
|
|
|
public ResultEntity<List<SysCourseChapter>> selectChapterByCourseId(@RequestParam String courseId){
|
|
|
|
public ResultEntity<List<SysCourseChapter>> selectChapterByCourseId(@RequestParam String courseId){
|
|
|
|
SysCourseChapterExample example = new SysCourseChapterExample();
|
|
|
|
SysCourseChapterExample example = new SysCourseChapterExample();
|
|
|
|
example.createCriteria().andCourseIdEqualTo(courseId);
|
|
|
|
example.createCriteria().andCourseIdEqualTo(courseId);
|
|
|
|
|
|
|
|
example.setOrderByClause("sequence asc");
|
|
|
|
List<SysCourseChapter> chapterList = chapterMapper.selectByExample(example);
|
|
|
|
List<SysCourseChapter> chapterList = chapterMapper.selectByExample(example);
|
|
|
|
return new ResultEntity(HttpStatus.OK, "展示成功", chapterList);
|
|
|
|
return new ResultEntity(HttpStatus.OK, "展示成功", chapterList);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -119,7 +121,7 @@ public class CourseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//增加章节
|
|
|
|
//增加章节
|
|
|
|
@GetMapping("insertChapter")
|
|
|
|
@PostMapping("insertChapter")
|
|
|
|
@ApiOperation("增加章节")
|
|
|
|
@ApiOperation("增加章节")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public ResultEntity insertChapter(@ApiParam("新增课程对象") @RequestBody SysCourseChapter chapter,@RequestParam String schoolId) {
|
|
|
|
public ResultEntity insertChapter(@ApiParam("新增课程对象") @RequestBody SysCourseChapter chapter,@RequestParam String schoolId) {
|
|
|
@ -150,7 +152,7 @@ public class CourseController {
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public ResultEntity deleteChapter(@ApiParam("删除章节Id") @RequestParam String chapterId,
|
|
|
|
public ResultEntity deleteChapter(@ApiParam("删除章节Id") @RequestParam String chapterId,
|
|
|
|
@RequestParam String schoolId){
|
|
|
|
@RequestParam String schoolId){
|
|
|
|
if(Constant.BUILT_IN_SCHOOL_ID.equals(schoolId)){
|
|
|
|
if(!Constant.BUILT_IN_SCHOOL_ID.equals(schoolId)){
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"权限不足");
|
|
|
|
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"权限不足");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int i = chapterMapper.deleteByPrimaryKey(chapterId);
|
|
|
|
int i = chapterMapper.deleteByPrimaryKey(chapterId);
|
|
|
|