mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-16 16:14:19 +08:00
章节删除
This commit is contained in:
@@ -60,14 +60,14 @@ public class CourseChapterController {
|
||||
public JsonResponse update(@PathVariable(name = "courseId") Integer courseId, @PathVariable(name = "id") Integer id, @RequestBody @Validated CourseChapterRequest req) throws NotFoundException {
|
||||
CourseChapter chapter = chapterService.findOrFail(id, courseId);
|
||||
chapterService.update(chapter, req.getName(), req.getSort());
|
||||
return JsonResponse.data(chapter);
|
||||
return JsonResponse.success();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public JsonResponse destroy(@PathVariable(name = "courseId") Integer courseId, @PathVariable(name = "id") Integer id) throws NotFoundException {
|
||||
CourseChapter chapter = chapterService.findOrFail(id, courseId);
|
||||
chapterService.removeById(chapter.getId());
|
||||
ctx.publishEvent(new CourseChapterDestroyEvent(this, PlayEduBackendThreadLocal.getAdminUserID(), chapter.getCourseId(), new Date()));
|
||||
ctx.publishEvent(new CourseChapterDestroyEvent(this, PlayEduBackendThreadLocal.getAdminUserID(), chapter.getCourseId(), chapter.getId(), new Date()));
|
||||
return JsonResponse.success();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user