package com.xindazhou.vehicle.api;

import com.xindazhou.framework.common.pojo.CommonResult;
import com.xindazhou.vehicle.api.dto.control.VehicleControlReqDTO;
import com.xindazhou.vehicle.service.VehicleControlService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import jakarta.validation.Valid;

import static com.xindazhou.framework.common.pojo.CommonResult.success;

/**
 * 车辆控制 API 实现类
 *
 * @author xindazhou
 */
@RestController
@Validated
public class VehicleControlApiImpl implements VehicleControlApi {

    @Resource
    private VehicleControlService vehicleControlService;

    @Override
    public CommonResult<Boolean> controlVehicle(@Valid VehicleControlReqDTO reqDTO) {
        vehicleControlService.controlVehicle(reqDTO);
        return success(true);
    }

}

