package com.sptg.device.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.device.api.entity.Device;
import com.sptg.device.api.entity.MqConf;
import com.sptg.device.api.feigns.fallback.DeviceRegisterFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * title: DeviceRegisterFeign
 * package: com.sptg.device.api.feigns
 * description: 设备注册服务接口
 */
@FeignClient(value = "smart-house-device",fallbackFactory = DeviceRegisterFeignFallbackFactory.class)
public interface DeviceRegisterFeign {

    /**
     * 功能描述: 根据设备序列号获取对联连接
     * @param device 设备信息
     * @return ResultBean<MqConf>
     */
    @PostMapping(value = "/device/register/getConnection")
    ResultBean<Device> getConnection(@RequestBody Device device);

    /**
     * 功能描述: 大豪适配器获取对联连接
     * @return ResultBean<MqConf>
     */
    @PostMapping(value = "/device/dh/register/getConnection")
    ResultBean<MqConf> getDHConnection();

}
