package com.xueyi.system.api.device.feign;

import com.xueyi.common.core.constant.basic.ServiceConstants;
import com.xueyi.common.core.web.result.R;
import com.xueyi.system.api.device.domain.po.DmDeviceTenantMergePo;
import com.xueyi.system.api.device.domain.vo.DeviceTenantSourceMergeVo;
import com.xueyi.system.api.organize.feign.factory.RemoteUserFallbackFactory;
import com.xueyi.tenant.api.source.domain.po.TeSourcePo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 设备租户服务
 *
 * @author yrx
 */
@FeignClient(contextId = "remoteDeviceTenantMergeService", value = ServiceConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteDeviceTenantMergeService {

    /**
     * 查询租户（企业）
     * @Param devId 设备编号
     *
     * @return 结果
     */
    @GetMapping("/device/inner/selectMerge")
    R<DmDeviceTenantMergePo> selectTenantMergeByDeviceInner(@RequestParam(value = "devId") String devId);

    @GetMapping("/device/inner/selectSourceByTenantId")
    R<TeSourcePo> selectSourceByTenantId(@RequestParam(value = "tenantId") Long tenantId);

    @GetMapping("/device/inner/selectSourceMerge")
    DeviceTenantSourceMergeVo selectDeviceTenantSourceMerge(@RequestParam(value = "devId") String devId);

    @GetMapping("/device/inner/selectDevSNSourceMerge/{devId}/{devSN}")
    R<DeviceTenantSourceMergeVo> selectDeviceSNTenantSourceMerge(@RequestParam(value = "devId") String devId,@RequestParam(value = "devSN") String devSN);
}