| | |
| | | import com.ruoyi.other.service.BannerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/banner") |
| | | @Api("轮播图") |
| | | @Api(tags = "轮播图") |
| | | public class BannerController { |
| | | @Resource |
| | | private BannerService bannerService; |
| | | @PostMapping("/index/list") |
| | | @ApiOperation(value = "banner列表", tags = {"小程序-首页"}) |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "banner列表", tags = {"小程序-banner"}) |
| | | public R<List<Banner>> list(String name, Integer jumpType, Integer position){ |
| | | List<Banner> list = bannerService.lambdaQuery().like(StringUtils.isNotEmpty(name), Banner::getName, name) |
| | | .eq(Banner::getJumpType, jumpType) |
| | | .eq(Banner::getPosition, position) |
| | | .eq(jumpType!=null,Banner::getJumpType, jumpType) |
| | | .eq(position!=null,Banner::getPosition, position) |
| | | .list(); |
| | | return R.ok(list); |
| | | } |