package com.muyu.car.gateway.controller;

import com.muyu.car.domain.api.req.VehicleConnectionReq;
import com.muyu.car.domain.model.MqttServerModel;
import com.muyu.car.domain.model.VehicleInformation;
import com.muyu.car.gateway.service.VehicleInformationService;
import com.muyu.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 车辆获取信息
 * @Author：蓬叁
 * @Package：com.muyu.car.gateway.controller
 * @Project：cloud-server-8
 * @name：VehicleInformationController
 * @Date：2024/10/6 下午2:39
 */
@RestController
@RequestMapping("/verify")
public class VehicleInformationController {

    @Autowired
    private VehicleInformationService vehicleInformationService;

    @PostMapping("/vehicleConnection")
    public Result<MqttServerModel> getVehicleData(
            @Validated @RequestBody VehicleConnectionReq vehicleConnectionReq
    ) {

        return Result.success(vehicleInformationService.getVehicleData(vehicleConnectionReq));
    }

}
