| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | for (MeditationEveryday record : page.getRecords()) { |
| | | record.setUid(record.getId()+""); |
| | | Meditation byId = meditationService.getById(record.getMeditationId()); |
| | | if (byId!=null){ |
| | | record.setMeditationTitle(byId.getMeditationTitle()); |
| | | } |
| | | } |
| | | return R.ok(PageDTO.of(page, MeditationEveryday.class)); |
| | | } |
| | |
| | | return R.ok(list); |
| | | } |
| | | @PostMapping("/addMeditationEveryday") |
| | | @ApiOperation(value = "新增每日冥想库管理", notes = "管理后台-每日冥想库管理") |
| | | @ApiOperation(value = "新增每日冥想库管理", tags = "管理后台-每日冥想库管理") |
| | | public R addMeditationEveryday(@RequestBody MeditationEveryday homeBackgroundMusic) { |
| | | homeBackgroundMusic.setCreateBy(SecurityUtils.getUsername()); |
| | | homeBackgroundMusic.setCreateTime(LocalDateTime.now()); |
| | | return R.ok(meditationEverydayService.save(homeBackgroundMusic)); |
| | | } |
| | | @GetMapping("/detailMeditationEveryday") |
| | | @ApiOperation(value = "查看详情每日冥想库管理", notes = "管理后台-每日冥想库管理") |
| | | @ApiOperation(value = "查看详情每日冥想库管理", tags = "管理后台-每日冥想库管理") |
| | | public R<MeditationEveryday> detailMeditationEveryday(String uid) { |
| | | return R.ok(meditationEverydayService.getById(uid)); |
| | | } |
| | | @PostMapping("/updateMeditationEveryday") |
| | | @ApiOperation(value = "修改每日冥想库管理", notes = "管理后台-每日冥想库管理") |
| | | @ApiOperation(value = "修改每日冥想库管理", tags = "管理后台-每日冥想库管理") |
| | | public R updateMeditationEveryday(@RequestBody MeditationEveryday homeBackgroundMusic) { |
| | | homeBackgroundMusic.setUpdateBy(SecurityUtils.getUsername()); |
| | | homeBackgroundMusic.setUpdateTime(LocalDateTime.now()); |
| | | return R.ok(meditationEverydayService.updateById(homeBackgroundMusic)); |
| | | } |
| | | @PostMapping("/deleteMeditationEveryday") |
| | | @ApiOperation(value = "批量删除", notes = "管理后台-每日冥想库管理") |
| | | @ApiOperation(value = "批量删除", tags = "管理后台-每日冥想库管理") |
| | | public R deleteMeditationEveryday(String ids) { |
| | | return R.ok(meditationEverydayService.removeBatchByIds(Arrays.asList(ids.split(",")))); |
| | | return R.ok(meditationEverydayService.removeBatchByIds(Arrays.asList(ids.split(",")).stream().map(Long::valueOf).collect(Collectors.toList()))); |
| | | } |
| | | } |
| | | |