课程分类删除

This commit is contained in:
none
2023-02-26 18:56:25 +08:00
parent 316d5d2d26
commit 9883faf3d1
5 changed files with 24 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import xyz.playedu.api.PlayEduBackendThreadLocal;
import xyz.playedu.api.constant.BPermissionConstant;
import xyz.playedu.api.domain.CourseCategory;
import xyz.playedu.api.event.CourseCategoryDestroyEvent;
@@ -77,9 +78,7 @@ public class CourseCategoryController {
public JsonResponse destroy(@PathVariable Integer id) throws NotFoundException {
CourseCategory category = categoryService.findOrFail(id);
categoryService.deleteById(category.getId());
ctx.publishEvent(new CourseCategoryDestroyEvent(this, id, new Date()));
ctx.publishEvent(new CourseCategoryDestroyEvent(this, PlayEduBackendThreadLocal.getAdminUserID(), category.getId(), new Date()));
return JsonResponse.success();
}