package org.jeecg.modules.checkData.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.checkData.dto.CorrugationRecordDTO;
import org.jeecg.modules.checkData.dto.RailWearRecordDTO;
import org.jeecg.modules.checkData.entity.CorrugationRecord;
import org.jeecg.modules.checkData.service.ICorrugationRecordService;
import org.jeecg.modules.checkData.vo.CorrugationRecordDetailVO;
import org.jeecg.modules.checkData.vo.CorrugationRecordVO;
import org.jeecg.modules.checkData.vo.RailWearRecordDetailVO;
import org.jeecg.modules.checkData.vo.RailWearRecordVO;
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 java.util.List;

/**
 * <p>
 * 检查数据-设备检查记录数据-钢轨波磨设备检查记录表	 前端控制器
 * </p>
 *
 * @author hkl
 * @since 2024-07-11
 */
@RestController
@RequestMapping("/checkData/corrugationRecord")
public class CorrugationRecordController extends JeecgController<CorrugationRecord, ICorrugationRecordService> {

    @AutoLog(value = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表-分页列表查询")
    @ApiOperation(value = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表-分页列表查询", notes = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<CorrugationRecordVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                            CorrugationRecordDTO dto) {
        Page<CorrugationRecordVO> pageData = new Page<>(pageNo, pageSize);
        pageData = this.service.queryPageList(pageData, dto);
        return Result.OK(pageData);
    }

    @AutoLog(value = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表检查详情页面")
    @ApiOperation(value = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表检查详情页面", notes = "检查数据-设备检查记录数据-钢轨波磨设备检查记录表检查详情页面")
    @GetMapping(value = "/getDetail")
    public Result<List<CorrugationRecordDetailVO>> getDetail(@ApiParam("id") String id,@ApiParam("code") String code) {
        List<CorrugationRecordDetailVO> data = this.service.getDetail(id,code);
        return Result.OK(data);
    }
}
