| | |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return R.ok(PageDTO.of(page, CourseCategory.class)); |
| | | } |
| | | @PostMapping("/addCourseCategory") |
| | | @ApiOperation(value = "新增分类管理", notes = "管理后台-分类管理") |
| | | @ApiOperation(value = "新增分类管理", tags = "管理后台-分类管理") |
| | | public R addCourseCategory(@RequestBody CourseCategory homeBackgroundMusic) { |
| | | homeBackgroundMusic.setCreateBy(SecurityUtils.getUsername()); |
| | | homeBackgroundMusic.setCreateTime(LocalDateTime.now()); |
| | | return R.ok(courseCategoryService.save(homeBackgroundMusic)); |
| | | } |
| | | @GetMapping("/detailCourseCategory") |
| | | @ApiOperation(value = "查看详情分类管理", notes = "管理后台-分类管理") |
| | | @ApiOperation(value = "查看详情分类管理", tags = "管理后台-分类管理") |
| | | public R<CourseCategory> detailCourseCategory(String uid) { |
| | | return R.ok(courseCategoryService.getById(uid)); |
| | | } |
| | | @PostMapping("/updateCourseCategory") |
| | | @ApiOperation(value = "修改分类管理", notes = "管理后台-分类管理") |
| | | @ApiOperation(value = "修改分类管理", tags = "管理后台-分类管理") |
| | | public R updateCourseCategory(@RequestBody CourseCategory homeBackgroundMusic) { |
| | | homeBackgroundMusic.setUpdateBy(SecurityUtils.getUsername()); |
| | | homeBackgroundMusic.setUpdateTime(LocalDateTime.now()); |
| | | return R.ok(courseCategoryService.updateById(homeBackgroundMusic)); |
| | | } |
| | | @PostMapping("/deleteCourseCategory") |
| | | @ApiOperation(value = "批量删除", notes = "管理后台-分类管理") |
| | | @ApiOperation(value = "批量删除", tags = "管理后台-分类管理") |
| | | public R deleteCourseCategory(String ids) { |
| | | return R.ok(courseCategoryService.removeBatchByIds(Arrays.asList(ids.split(",")))); |
| | | return R.ok(courseCategoryService.removeBatchByIds(Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()))); |
| | | } |
| | | } |
| | | |