Commit bb0edc2a654b5eb8c64f112383196db40a021731
1 parent
247d299c
Banner app api for reveiew
Showing
3 changed files
with
52 additions
and
0 deletions
yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.market.controller.app.banner; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerRespVO; | ||
| 5 | +import cn.iocoder.yudao.module.market.convert.banner.BannerConvert; | ||
| 6 | +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; | ||
| 7 | +import cn.iocoder.yudao.module.market.service.banner.BannerService; | ||
| 8 | +import io.swagger.annotations.Api; | ||
| 9 | +import io.swagger.annotations.ApiOperation; | ||
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 11 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 12 | +import org.springframework.validation.annotation.Validated; | ||
| 13 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.RestController; | ||
| 16 | + | ||
| 17 | +import java.util.List; | ||
| 18 | + | ||
| 19 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * @author: XIA | ||
| 23 | + */ | ||
| 24 | +@RestController | ||
| 25 | +@RequestMapping("/market/banner") | ||
| 26 | +@Api(tags = "用户APP- 首页Banner") | ||
| 27 | +@Validated | ||
| 28 | +public class AppBannerController { | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + private BannerService bannerService; | ||
| 32 | + | ||
| 33 | + @GetMapping("/list") | ||
| 34 | + @ApiOperation("获得banner列表") | ||
| 35 | + @PreAuthorize("@ss.hasPermission('market:banner:query')") | ||
| 36 | + public CommonResult<List<BannerRespVO>> getBannerList() { | ||
| 37 | + List<BannerDO> list = bannerService.getBannerList(); | ||
| 38 | + return success(BannerConvert.INSTANCE.convertList(list)); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | +} |
yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java
| @@ -57,6 +57,12 @@ public interface BannerService { | @@ -57,6 +57,12 @@ public interface BannerService { | ||
| 57 | List<BannerDO> getBannerList(Collection<Long> ids); | 57 | List<BannerDO> getBannerList(Collection<Long> ids); |
| 58 | 58 | ||
| 59 | /** | 59 | /** |
| 60 | + * 获得所有Banner列表 | ||
| 61 | + * @return Banner列表 | ||
| 62 | + */ | ||
| 63 | + List<BannerDO> getBannerList(); | ||
| 64 | + | ||
| 65 | + /** | ||
| 60 | * 获得Banner分页 | 66 | * 获得Banner分页 |
| 61 | * | 67 | * |
| 62 | * @param pageReqVO 分页查询 | 68 | * @param pageReqVO 分页查询 |
yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java
| @@ -73,6 +73,11 @@ public class BannerServiceImpl implements BannerService { | @@ -73,6 +73,11 @@ public class BannerServiceImpl implements BannerService { | ||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | @Override | 75 | @Override |
| 76 | + public List<BannerDO> getBannerList() { | ||
| 77 | + return bannerMapper.selectList(); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + @Override | ||
| 76 | public PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO) { | 81 | public PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO) { |
| 77 | return bannerMapper.selectPage(pageReqVO); | 82 | return bannerMapper.selectPage(pageReqVO); |
| 78 | } | 83 | } |