package cn.iocoder.yudao.module.inspection.controller.app;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.inspection.entity.SiteInfo;
import cn.iocoder.yudao.module.inspection.service.ISiteInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@RequestMapping("/inspection/info")
public class AppSiteInfoController {

    @Autowired
    private ISiteInfoService siteInfoService;

    /**
     * 查询inspection列表
     */
    @GetMapping("/list")
    @TenantIgnore
    public CommonResult<?> list(SiteInfo siteInfo, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize)
    {
        Page<SiteInfo> page = new Page<>(pageNum, pageSize);
        IPage<SiteInfo> list = siteInfoService.selectSiteInfoList(page,siteInfo);
        return success(list);
    }
}
