| | |
| | | |
| | | @PostMapping("/addbanner") |
| | | public ResponseVO<Object> addBanner(@Validated @RequestBody BannerParam bannerParam) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | Client client = clientService.getOne(Wrappers.lambdaQuery(Client.class).eq(Client::getId, bannerParam.getBinding_author())); |
| | | |
| | | |
| | | boolean result = contentBannerService.addBanner(bannerParam, client); |
| | | if (result) { |
| | |
| | | |
| | | @PostMapping("/{bannerId}") |
| | | public ResponseVO<Object> updateBanner(@PathVariable Long bannerId, @Validated @RequestBody BannerParam bannerParam) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_UPDATE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = contentBannerService.updateBanner(bannerId, bannerParam); |
| | | if (result) { |
| | | return ResponseUtil.success("更新成功"); |
| | |
| | | } |
| | | } |
| | | |
| | | //前端并未调用 |
| | | @GetMapping("/{bannerId}") |
| | | public ResponseVO<Object> detailBanner(@PathVariable Long bannerId) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_DETAIL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | BannerDto result = contentBannerService.detailBanner(bannerId); |
| | | return ResponseUtil.success(result); |
| | | } |
| | |
| | | |
| | | @PostMapping("/delete/{bannerId}") |
| | | public ResponseVO<Object> deleteBanner(@PathVariable Long bannerId) { |
| | | if (!permissionConfig.check(MenuEnum.BANNER_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = contentBannerService.deleteBanner(bannerId); |
| | | if (result) { |
| | | return ResponseUtil.success("删除成功"); |