| | |
| | | import com.xinquan.common.core.domain.R; |
| | | import com.xinquan.common.core.utils.page.CollUtils; |
| | | import com.xinquan.common.core.utils.page.PageDTO; |
| | | import com.xinquan.common.log.annotation.Log; |
| | | import com.xinquan.common.log.enums.BusinessType; |
| | | import com.xinquan.common.security.utils.SecurityUtils; |
| | | import com.xinquan.meditation.domain.MeditationCategory; |
| | | import com.xinquan.meditation.service.MeditationCategoryService; |
| | |
| | | |
| | | 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 = "管理后台-冥想分类管理") |
| | | @Log(title = "【冥想分类管理】修改", businessType = BusinessType.UPDATE) |
| | | 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()))); |
| | | } |
| | | } |
| | | |