package com.muyu.fault.controller;


import com.muyu.common.core.domain.Result;
import com.muyu.fault.domain.CarFaultRule;
import com.muyu.fault.domain.FaultRule;
import com.muyu.fault.service.FaultRuleService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: FaultLog  ️✈️
 * @author: Yang 鹏  🦅
 * @date: 2024/9/23 21:06 ⏰
 * @Version: 1.0
 * @description: 故障检测
 */
@RestController
@RequestMapping("/faultrule")
public class FaultRuleController {

    @Autowired
    private FaultRuleService faultRuleService;


    /**
     * 车辆故障检测
     * @return
     */
    @PostMapping("/check-faults")
    @Operation(summary = "检查故障",description = "进行故障检查")
    public Result checkfault(@Validated FaultRule faultRule){
        String checkfaults = faultRuleService.checkfaults(faultRule);
        return Result.success(checkfaults);
    }


    @PostMapping("/cheakfaults")
    @Operation(summary = "故障参数匹配检查",description = "获取报文数据与故障参数进行比较")
    public Result cheakfaults(@Validated @RequestBody CarFaultRule carFaultRule){
//        faultRuleService.checkfaults(carFaultRule);
        return null;
    }
}
