package com.xindazhou.vehicle.api;

import com.xindazhou.framework.common.pojo.CommonResult;
import com.xindazhou.vehicle.api.dto.control.VehicleControlReqDTO;
import com.xindazhou.vehicle.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import jakarta.validation.Valid;

/**
 * 车辆控制 API
 *
 * @author xindazhou
 */
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 车辆控制")
public interface VehicleControlApi {

    String PREFIX = "/rpc-api/vehicle/control";

    @PostMapping(PREFIX + "/control")
    @Operation(summary = "控制车辆", description = "支持开锁、关锁、启动、熄火等操作")
    CommonResult<Boolean> controlVehicle(@Valid @RequestBody VehicleControlReqDTO reqDTO);

}

