package org.jeecg.modules.checkData.dynamicStaticGeometricData.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.*;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.dto.RailInspectionEquipmentDTO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetailVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentItemService;
import org.springframework.web.bind.annotation.*;

import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.web.multipart.MultipartFile;

import javax.transaction.Transactional;
import java.util.List;

/**
 * <p>
 * 检查数据-动静态几何尺寸数据-轨检仪静态检查数据-检查项目 前端控制器
 * </p>
 *
 * @author hkl
 * @since 2023-07-16
 */
@RestController
@RequestMapping("/checkData/dynamicStaticGeometricData/railInspectionEquipmentItem")
public class RailInspectionEquipmentItemController extends JeecgController<RailInspectionEquipmentItem, IRailInspectionEquipmentItemService> {

    @AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询")
    @ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询")
    @GetMapping(value = "/list")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "railInspectionEquipmentId", value = "轨检仪静态检查数据id")
    })
    public Result<List<RailInspectionEquipmentItemVO>> queryList(String railInspectionEquipmentId) {
        List<RailInspectionEquipmentItemVO> record = this.service.queryList(railInspectionEquipmentId);
        return Result.OK(record);
    }

    @AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表")
    @ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表")
    @GetMapping(value = "/detailList")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "railInspectionEquipmentItemId", value = "轨检仪静态检查项目id")
    })
    public Result<List<RailInspectionEquipmentItemDetailVO>> detailList(String railInspectionEquipmentItemId) {
        List<RailInspectionEquipmentItemDetailVO> record = this.service.detailList(railInspectionEquipmentItemId);
        return Result.OK(record);
    }


    @PostMapping(value = "/upload")
    @AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入")
    @ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "railInspectionEquipmentId", value = "轨检仪静态检查数据id"),
            @ApiImplicitParam(name = "file", value = "文件"),
    })
    public Result<String> uploadFile(String railInspectionEquipmentId, MultipartFile file) {

        this.service.uploadFile(railInspectionEquipmentId, file);

        return Result.ok("操作成功");
    }

}
