package com.yuchen.saas.device.api.feign.deviceCenter;

import com.yuchen.saas.device.api.dto.deviceCenter.SyncDeviceDataDeleteReqDTO;
import com.yuchen.saas.device.api.dto.deviceCenter.SyncDeviceDataSubmitReqDTO;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author zhouhanwei
 * @create 2024/8/28 10:05
 */
@FeignClient(
        value = AppNameConstant.SAAS_DEVICE,
        fallbackFactory = DeviceCenterFeignFallback.class
)
public interface DeviceCenterFeign {

    /**
     * 同步设备到智能硬件中心
     * @param reqDTO 入参
     * @return R 返回值
     */
    @PostMapping("/deviceCenter/syncSubmitDeviceData")
    R syncSubmitDeviceData(@Validated @RequestBody SyncDeviceDataSubmitReqDTO reqDTO);

    /**
     * 同步删除设备到智能硬件中心
     * @param reqDTO 入参
     * @return R 返回
     */
    @PostMapping("/deviceCenter/syncDeleteDeviceData")
    R syncDeleteDeviceData(@Validated @RequestBody SyncDeviceDataDeleteReqDTO reqDTO);
}
