package com.xunmei.system.api;

import com.xunmei.common.core.constant.SecurityConstants;
import com.xunmei.common.core.constant.ServiceNameConstants;
import com.xunmei.system.api.domain.SysDevice;
import com.xunmei.system.api.factory.RemoteConfigFallbackFactory;
import com.xunmei.system.api.factory.RemoteDeviceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author :LuoWei
 * @date : 2023/8/29
 */
@FeignClient(contextId = "remoteDeviceService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeviceFallbackFactory.class)
public interface RemoteDeviceService {
    @GetMapping("/device/getSysDeviceByOrgId")
    List<SysDevice> getSysDeviceByOrgId(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @GetMapping("/device/getSysDeviceByHostId")
    List<SysDevice> getSysDeviceByHostId(@RequestParam("hostId")Long hostId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
