diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java new file mode 100644 index 000000000..783179e85 --- /dev/null +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/controller/app/banner/AppBannerController.java @@ -0,0 +1,41 @@ +package cn.iocoder.yudao.module.market.controller.app.banner; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.market.controller.admin.banner.vo.BannerRespVO; +import cn.iocoder.yudao.module.market.convert.banner.BannerConvert; +import cn.iocoder.yudao.module.market.dal.dataobject.banner.BannerDO; +import cn.iocoder.yudao.module.market.service.banner.BannerService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + * @author: XIA + */ +@RestController +@RequestMapping("/market/banner") +@Api(tags = "用户APP- 首页Banner") +@Validated +public class AppBannerController { + + @Autowired + private BannerService bannerService; + + @GetMapping("/list") + @ApiOperation("获得banner列表") + @PreAuthorize("@ss.hasPermission('market:banner:query')") + public CommonResult> getBannerList() { + List list = bannerService.getBannerList(); + return success(BannerConvert.INSTANCE.convertList(list)); + } + +} diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java index 29ae4adac..f69898187 100644 --- a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerService.java @@ -56,6 +56,12 @@ public interface BannerService { */ List getBannerList(Collection ids); + /** + * 获得所有Banner列表 + * @return Banner列表 + */ + List getBannerList(); + /** * 获得Banner分页 * diff --git a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java index bd3ded681..d2b25c0a7 100644 --- a/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java +++ b/yudao-module-mall/yudao-module-market-biz/src/main/java/cn/iocoder/yudao/module/market/service/banner/BannerServiceImpl.java @@ -72,6 +72,11 @@ public class BannerServiceImpl implements BannerService { return bannerMapper.selectBatchIds(ids); } + @Override + public List getBannerList() { + return bannerMapper.selectList(); + } + @Override public PageResult getBannerPage(BannerPageReqVO pageReqVO) { return bannerMapper.selectPage(pageReqVO);