|
@@ -15,12 +15,10 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.validation.Valid;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.List;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
-@Api(tags = "管理后台 - Banner管理")
|
|
|
+@Api(tags = "管理后台 - Banner 管理")
|
|
|
@RestController
|
|
|
@RequestMapping("/market/banner")
|
|
|
@Validated
|
|
@@ -30,14 +28,14 @@ public class BannerController {
|
|
|
private BannerService bannerService;
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
- @ApiOperation("创建banner")
|
|
|
+ @ApiOperation("创建 Banner")
|
|
|
@PreAuthorize("@ss.hasPermission('market:banner:create')")
|
|
|
public CommonResult<Long> createBanner(@Valid @RequestBody BannerCreateReqVO createReqVO) {
|
|
|
return success(bannerService.createBanner(createReqVO));
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
- @ApiOperation("更新banner")
|
|
|
+ @ApiOperation("更新 Banner")
|
|
|
@PreAuthorize("@ss.hasPermission('market:banner:update')")
|
|
|
public CommonResult<Boolean> updateBanner(@Valid @RequestBody BannerUpdateReqVO updateReqVO) {
|
|
|
bannerService.updateBanner(updateReqVO);
|
|
@@ -45,7 +43,7 @@ public class BannerController {
|
|
|
}
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
- @ApiOperation("删除banner")
|
|
|
+ @ApiOperation("删除 Banner")
|
|
|
@ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
|
|
|
@PreAuthorize("@ss.hasPermission('market:banner:delete')")
|
|
|
public CommonResult<Boolean> deleteBanner(@RequestParam("id") Long id) {
|
|
@@ -54,7 +52,7 @@ public class BannerController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
- @ApiOperation("获得banner")
|
|
|
+ @ApiOperation("获得 Banner")
|
|
|
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
|
|
|
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
|
|
public CommonResult<BannerRespVO> getBanner(@RequestParam("id") Long id) {
|
|
@@ -62,30 +60,12 @@ public class BannerController {
|
|
|
return success(BannerConvert.INSTANCE.convert(banner));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/list")
|
|
|
- @ApiOperation("获得banner列表")
|
|
|
- @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
|
|
- @PreAuthorize("@ss.hasPermission('market:banner:query')")
|
|
|
- public CommonResult<List<BannerRespVO>> getBannerList(@RequestParam("ids") Collection<Long> ids) {
|
|
|
- List<BannerDO> list = bannerService.getBannerList(ids);
|
|
|
- return success(BannerConvert.INSTANCE.convertList(list));
|
|
|
- }
|
|
|
-
|
|
|
@GetMapping("/page")
|
|
|
- @ApiOperation("获得Banner分页")
|
|
|
+ @ApiOperation("获得 Banner 分页")
|
|
|
@PreAuthorize("@ss.hasPermission('market:banner:query')")
|
|
|
public CommonResult<PageResult<BannerRespVO>> getBannerPage(@Valid BannerPageReqVO pageVO) {
|
|
|
PageResult<BannerDO> pageResult = bannerService.getBannerPage(pageVO);
|
|
|
return success(BannerConvert.INSTANCE.convertPage(pageResult));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @GetMapping("/update-status")
|
|
|
- @ApiOperation("Banner上下架")
|
|
|
- @PreAuthorize("@ss.hasPermission('market:banner:update')")
|
|
|
- public CommonResult<Boolean> updateBannerStatus(@Valid @RequestBody BannerUpdateStatusReqVO reqVO) {
|
|
|
- bannerService.updateBannerStatus(reqVO);
|
|
|
- return success(true);
|
|
|
- }
|
|
|
-
|
|
|
}
|