package com.muyu.enterpise.controller;


import com.muyu.common.core.domain.Result;
import com.muyu.domain.CarFaultRule;
import com.muyu.domain.FaultRule;
import com.muyu.enterpise.service.FaultRuleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
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: FaultRuleController  ️✈️
 *  * @author: Yang 鹏  🦅
 *  * @date: 2024/9/23 21:06 ⏰
 *  * @Version: 1.0
 *  * @description: 故障检测
 */
@RestController
@RequestMapping("/faultrule")
@Tag(name = "车辆故障检测模块",description = "车辆故障检测模块")
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);
    }

    /**
     * 故障参数匹配检查
     *
     * @param carFaultRule
     * @return
     */

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