package com.iailab.module.system.api.tenant; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.module.system.api.tenant.dto.TenantDataSourceConfigRespDTO; import com.iailab.module.system.enums.ApiConstants; import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @FeignClient(name = ApiConstants.NAME) @Tag(name = "RPC 服务 - 多租户") public interface TenantApi { String PREFIX = ApiConstants.PREFIX + "/tenant"; @GetMapping(PREFIX + "/id-list") @Operation(summary = "获得所有租户编号") CommonResult> getTenantIdList(); @GetMapping(PREFIX + "/valid") @Operation(summary = "校验租户是否合法") @Parameter(name = "id", description = "租户编号", required = true, example = "1024") CommonResult validTenant(@RequestParam("id") Long id); @GetMapping(PREFIX + "/data-source") @Operation(summary = "获得租户的数据源配置") @Parameters( @Parameter(name = "tenantId", description = "租户编号", example = "2", required = true) ) TenantDataSourceConfigRespDTO getTenantDataSourceConfig(@RequestParam("tenantId") Long tenantId); }