package com.usky.system;

import com.usky.system.factory.RemoteTenantFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author yq
 * @date 2022/7/12 13:13
 */
@FeignClient(contextId = "remoteTenantService", value = "usky-system", fallbackFactory = RemoteTenantFallbackFactory.class)
public interface RemoteTenantService {

    /**
     * 获得所有租户
     *
     * @return 租户编号数组
     */
    @GetMapping("/getTenantIds")
    List<Integer> getTenantIds();

    /**
     * 校验租户是否合法
     *
     * @param id 租户编号
     */
    @GetMapping("/validTenant")
    Boolean validTenant(@RequestParam("id") Integer id);
}
