Banner app api for reveiew

This commit is contained in:
xiaxiaoYY 2022-05-31 18:30:24 +08:00
parent 247d299cca
commit bb0edc2a65
3 changed files with 52 additions and 0 deletions

View File

@ -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<List<BannerRespVO>> getBannerList() {
List<BannerDO> list = bannerService.getBannerList();
return success(BannerConvert.INSTANCE.convertList(list));
}
}

View File

@ -56,6 +56,12 @@ public interface BannerService {
*/
List<BannerDO> getBannerList(Collection<Long> ids);
/**
* 获得所有Banner列表
* @return Banner列表
*/
List<BannerDO> getBannerList();
/**
* 获得Banner分页
*

View File

@ -72,6 +72,11 @@ public class BannerServiceImpl implements BannerService {
return bannerMapper.selectBatchIds(ids);
}
@Override
public List<BannerDO> getBannerList() {
return bannerMapper.selectList();
}
@Override
public PageResult<BannerDO> getBannerPage(BannerPageReqVO pageReqVO) {
return bannerMapper.selectPage(pageReqVO);