package com.yuchen.saas.parking.api.feign;

import com.yuchen.saas.parking.api.vo.OpenGateCommand;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 黄辉
 * @version 1.0
 * @date 2021/5/14 16:03
 */
@FeignClient(
        value = AppNameConstant.SAAS_PARKING,
        fallback = ParkingScreenClientFallback.class
)
public interface ParkingScreenClient {

    /**
     * 下发的控制
     * @param openGateCommand
     * @return
     */
    @PostMapping("/screen/parking/device/control")
    R sendGateCommand(@RequestBody OpenGateCommand openGateCommand);

    /**
     * 无牌车发送放行事件
     * @param parkingId 停车场ID
     * @param plateNo 车牌号
     * @return
     */
    @GetMapping("/screen/parking/noPlate/exitEvent")
    R sendNoPlateExitEvent(@RequestParam Long parkingId, @RequestParam String plateNo);
}
