package com.om.controller.admin;


import com.om.entity.dto.AppBaseDTO;
import com.om.entity.dto.RepairDTO;
import com.om.entity.dto.RepairQueryPageDTO;
import com.om.entity.vo.RepairQueryPageVO;
import com.om.entity.vo.RepairVO;
import com.om.service.IRepairService;
import com.om.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bmmx
 * @since 2024-02-18
 */
@RestController
@RequestMapping("/web/diagnosis/report")
@Api(tags = "诊断报告模块接口")
public class RepairController {

    @Resource
    IRepairService repairService;

    @PostMapping("/create")
    @ApiOperation("创建诊断报告")
    Result create(@RequestBody RepairDTO repairDTO){

        return repairService.create(repairDTO);
    }

    @GetMapping("/delete")
    @ApiOperation("删除诊断报告")
    Result delete (@RequestBody AppBaseDTO dto){
        return repairService.delete(dto);
    }
    @GetMapping("/getById")
    @ApiOperation("获取指定指定报告")
    Result<RepairVO>  getById(@RequestParam Integer id){

        return repairService.getByIds(id);
    }

    @PostMapping("/getPageList")
    @ApiOperation("获取报告分页集合")
    Result<RepairQueryPageVO>  getPageList(@RequestBody RepairQueryPageDTO dto){
        return repairService.getPageList(dto);
    }



}
