package org.springblade.system.client;

import java.util.List;

import org.springblade.common.openfeign.OpenFeignConstants;
import org.springblade.system.client.factory.TenantClientFallbackFactory;
import org.springblade.system.client.model.TenantModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author hepingguo
 * @version 1.0
 * @description: TODO
 * @date 2023/11/25 11:53
 */
@FeignClient(contextId = "tenantClient",
        value = OpenFeignConstants.SYSTEM_SERVICE,
        fallbackFactory = TenantClientFallbackFactory.class)
public interface TenantClient {

    /**
     * 全量获取租户信息
     */
    @GetMapping(OpenFeignConstants.SYSTEM_SERVICE + "/tenantList")
    List<TenantModel> getTenantList(@RequestParam(value = "tenantId", required = false) String tenantId);

    /**
     * 通过租户id集合查询租户信息
     */
    @GetMapping(OpenFeignConstants.SYSTEM_SERVICE + "/tenantList/ids")
    List<TenantModel> getTenantByTenantIds(@RequestParam(value = "tenantIds", required = false) List<String> tenantIds);
}
