puzhibing
2023-11-28 7b726d5ff439e7b8bb66369ecc5881e370286bc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.stylefeng.guns.modular.api;
 
import com.stylefeng.guns.modular.system.service.IBannerService;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.warpper.res.BannerRes;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @author zhibing.pu
 * @Date 2023/11/7 16:42
 */
@RestController
@RequestMapping("")
public class BannerController {
 
    @Autowired
    private IBannerService bannerService;
 
 
 
    @ResponseBody
    @GetMapping("/base/banner/getBanners")
    @ApiOperation(value = "获取各种banner", tags = {"首页"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "position", value = "位置(1=首页,2=详情)", required = true)
    })
    public ResultUtil<List<BannerRes>> getBanners(Integer position){
        List<BannerRes> banners = bannerService.getBanners(position);
        return ResultUtil.success(banners);
    }
}