Commit ff3b1e942ac2e3d9584e109b92eef46b1af3b603
1 parent
3672d0f2
Banner: market ==> promotion
Showing
2 changed files
with
8 additions
and
6 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/BannerController.java
| ... | ... | @@ -23,7 +23,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 23 | |
| 24 | 24 | @Tag(name = "管理后台 - Banner 管理") |
| 25 | 25 | @RestController |
| 26 | -@RequestMapping("/market/banner") | |
| 26 | +@RequestMapping("/promotion/banner") | |
| 27 | 27 | @Validated |
| 28 | 28 | public class BannerController { |
| 29 | 29 | |
| ... | ... | @@ -32,14 +32,14 @@ public class BannerController { |
| 32 | 32 | |
| 33 | 33 | @PostMapping("/create") |
| 34 | 34 | @Operation(summary = "创建 Banner") |
| 35 | - @PreAuthorize("@ss.hasPermission('market:banner:create')") | |
| 35 | + @PreAuthorize("@ss.hasPermission('promotion:banner:create')") | |
| 36 | 36 | public CommonResult<Long> createBanner(@Valid @RequestBody BannerCreateReqVO createReqVO) { |
| 37 | 37 | return success(bannerService.createBanner(createReqVO)); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | @PutMapping("/update") |
| 41 | 41 | @Operation(summary = "更新 Banner") |
| 42 | - @PreAuthorize("@ss.hasPermission('market:banner:update')") | |
| 42 | + @PreAuthorize("@ss.hasPermission('promotion:banner:update')") | |
| 43 | 43 | public CommonResult<Boolean> updateBanner(@Valid @RequestBody BannerUpdateReqVO updateReqVO) { |
| 44 | 44 | bannerService.updateBanner(updateReqVO); |
| 45 | 45 | return success(true); |
| ... | ... | @@ -48,7 +48,7 @@ public class BannerController { |
| 48 | 48 | @DeleteMapping("/delete") |
| 49 | 49 | @Operation(summary = "删除 Banner") |
| 50 | 50 | @Parameter(name = "id", description = "编号", required = true) |
| 51 | - @PreAuthorize("@ss.hasPermission('market:banner:delete')") | |
| 51 | + @PreAuthorize("@ss.hasPermission('promotion:banner:delete')") | |
| 52 | 52 | public CommonResult<Boolean> deleteBanner(@RequestParam("id") Long id) { |
| 53 | 53 | bannerService.deleteBanner(id); |
| 54 | 54 | return success(true); |
| ... | ... | @@ -57,7 +57,7 @@ public class BannerController { |
| 57 | 57 | @GetMapping("/get") |
| 58 | 58 | @Operation(summary = "获得 Banner") |
| 59 | 59 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 60 | - @PreAuthorize("@ss.hasPermission('market:banner:query')") | |
| 60 | + @PreAuthorize("@ss.hasPermission('promotion:banner:query')") | |
| 61 | 61 | public CommonResult<BannerRespVO> getBanner(@RequestParam("id") Long id) { |
| 62 | 62 | BannerDO banner = bannerService.getBanner(id); |
| 63 | 63 | return success(BannerConvert.INSTANCE.convert(banner)); |
| ... | ... | @@ -65,7 +65,7 @@ public class BannerController { |
| 65 | 65 | |
| 66 | 66 | @GetMapping("/page") |
| 67 | 67 | @Operation(summary = "获得 Banner 分页") |
| 68 | - @PreAuthorize("@ss.hasPermission('market:banner:query')") | |
| 68 | + @PreAuthorize("@ss.hasPermission('promotion:banner:query')") | |
| 69 | 69 | public CommonResult<PageResult<BannerRespVO>> getBannerPage(@Valid BannerPageReqVO pageVO) { |
| 70 | 70 | PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO); |
| 71 | 71 | return success(BannerConvert.INSTANCE.convertPage(pageResult)); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/banner/vo/BannerBaseVO.java
| ... | ... | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.validation.InEnum; |
| 5 | +import cn.iocoder.yudao.module.promotion.enums.banner.BannerPositionEnum; | |
| 5 | 6 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 7 | import lombok.Data; |
| 7 | 8 | |
| ... | ... | @@ -29,6 +30,7 @@ public class BannerBaseVO { |
| 29 | 30 | |
| 30 | 31 | @Schema(description = "position", requiredMode = Schema.RequiredMode.REQUIRED) |
| 31 | 32 | @NotNull(message = "position 不能为空") |
| 33 | + @InEnum(BannerPositionEnum.class) | |
| 32 | 34 | private Integer position; |
| 33 | 35 | |
| 34 | 36 | @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED) | ... | ... |