提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.api.tenant; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
c39abc
|
4 |
import com.iailab.module.system.api.tenant.dto.TenantDataSourceConfigRespDTO; |
e7c126
|
5 |
import com.iailab.module.system.enums.ApiConstants; |
bef362
|
6 |
import io.swagger.v3.oas.annotations.Parameters; |
e7c126
|
7 |
import io.swagger.v3.oas.annotations.tags.Tag; |
H |
8 |
import io.swagger.v3.oas.annotations.Parameter; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import org.springframework.cloud.openfeign.FeignClient; |
|
11 |
import org.springframework.web.bind.annotation.GetMapping; |
|
12 |
import org.springframework.web.bind.annotation.RequestParam; |
|
13 |
|
|
14 |
import java.util.List; |
|
15 |
|
1ecdfb
|
16 |
@FeignClient(name = ApiConstants.NAME) |
e7c126
|
17 |
@Tag(name = "RPC 服务 - 多租户") |
H |
18 |
public interface TenantApi { |
|
19 |
|
|
20 |
String PREFIX = ApiConstants.PREFIX + "/tenant"; |
|
21 |
|
|
22 |
@GetMapping(PREFIX + "/id-list") |
|
23 |
@Operation(summary = "获得所有租户编号") |
|
24 |
CommonResult<List<Long>> getTenantIdList(); |
|
25 |
|
|
26 |
@GetMapping(PREFIX + "/valid") |
|
27 |
@Operation(summary = "校验租户是否合法") |
|
28 |
@Parameter(name = "id", description = "租户编号", required = true, example = "1024") |
|
29 |
CommonResult<Boolean> validTenant(@RequestParam("id") Long id); |
|
30 |
|
c39abc
|
31 |
@GetMapping(PREFIX + "/data-source") |
潘 |
32 |
@Operation(summary = "获得租户的数据源配置") |
bef362
|
33 |
@Parameters( |
潘 |
34 |
@Parameter(name = "tenantId", description = "租户编号", example = "2", required = true) |
|
35 |
) |
c39abc
|
36 |
TenantDataSourceConfigRespDTO getTenantDataSourceConfig(@RequestParam("tenantId") Long tenantId); |
潘 |
37 |
|
e7c126
|
38 |
} |