package com.ylx.banner.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.banner.domain.Banner;
import com.ylx.banner.domain.vo.BannerVO;
import com.ylx.banner.service.BannerService;
import com.ylx.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/customer/banner")
@Api(tags = {"客户端轮播图"})
@Slf4j
public class CustomerBannerController {

    @Resource
    private BannerService bannerService;

    @ApiOperation("客户端首页分页查询轮播图数据")
    @PostMapping("/page")
    public R<Page<BannerVO>> page(Page<Banner> page) {
        Page<BannerVO> pageData = this.bannerService.page(page);
        return R.ok(pageData);
    }

}
