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