package com.om.controller.user;


import com.om.entity.dto.APPRepairQueryPageDTO;
import com.om.entity.dto.APPReportCreateDTO;
import com.om.entity.dto.AppBaseDTO;
import com.om.entity.dto.AppRepairUpdateBaseDTO;
import com.om.entity.vo.AppRepairQueryPageVO;
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
@Api(tags = "用户端诊断报告")
@RequestMapping("/app/diagnosis/report")
public class APPRepairController {

    @Resource
    private IRepairService repairService;

    @PostMapping("/create")
    @ApiOperation("创建诊断报告")
    public Result createReport(@RequestBody APPReportCreateDTO dto){
        return repairService.AppCreateReport(dto);
    }


    @PostMapping("/getPageList")
    @ApiOperation("获取诊断报告列表")
    public Result<AppRepairQueryPageVO> getPageList(@RequestBody APPRepairQueryPageDTO dto){
        return repairService.AppGetPageList(dto);
    }


    @PostMapping("/delete")
    @ApiOperation("删除诊断报告列表")
    public Result delete(@RequestBody AppBaseDTO dto){
        return repairService.delete(dto);
    }

    @PostMapping("/getH5")
    @ApiOperation("根据ID获取诊断报告H5")
    public Result<String> getH5(@RequestBody AppBaseDTO dto){
        return repairService.getH5(dto);
    }


    @PostMapping("/updateBase")
    @ApiOperation("查看诊断报告里的修改基础信息接口")
    public Result updateBase(@RequestBody AppRepairUpdateBaseDTO dto){
        return repairService.updateBase(dto);
    }

    @PostMapping("/updateCompany")
    @ApiOperation("查看诊断报告里的修改公司信息接口")
    public Result updateCompany(@RequestBody AppRepairUpdateBaseDTO dto){
        return repairService.updateCompany(dto);
    }
}
