package com.yuchen.saas.park.api.feign.service;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.dto.park.IoTEvent;
import com.yuchen.saas.park.api.entity.fault.ConnectEvent;
import com.yuchen.saas.park.api.vo.fault.DeviceProperty;
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;

@FeignClient(
        value = AppNameConstant.SAAS_PARK,
        fallbackFactory = DeviceInputFeignServiceFallback.class
)
public interface DeviceInputFeignService {
    @PostMapping("/device/input/deviceConnectInput")
    @ApiOperationSupport(order = 1)
    R deviceConnectInput(@RequestBody ConnectEvent connectEvent);
    @PostMapping("/device/input/deviceEventInput")
    @ApiOperationSupport(order = 1)
    R deviceEventInput(@RequestBody IoTEvent ioTEvent);
    @PostMapping("/device/input/devicePropertyInput")
    @ApiOperationSupport(order = 1)
    R devicePropertyInput(@RequestBody DeviceProperty deviceProperty);

    @GetMapping("/doorDeviceEvent/receiveIotDoorEventInfo")
    @ApiOperationSupport(order = 1)
    R receiveIotDoorEventInfo(@RequestParam("doorEventInfoJson") String doorEventInfoJson);

}
