From 7da8f196dee8e3c526c009a4bc7f5983ece6bb97 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期三, 16 十月 2024 09:50:11 +0800 Subject: [PATCH] 修改平台的应用权限等相关接口 --- iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/api/tenant/TenantApiImpl.java | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/api/tenant/TenantApiImpl.java b/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/api/tenant/TenantApiImpl.java index 9dd9f65..e03959e 100644 --- a/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/api/tenant/TenantApiImpl.java +++ b/iailab-module-system/iailab-module-system-biz/src/main/java/com/iailab/module/system/api/tenant/TenantApiImpl.java @@ -1,6 +1,10 @@ package com.iailab.module.system.api.tenant; import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.module.infra.api.db.DataSourceConfigServiceApi; +import com.iailab.module.system.api.tenant.dto.TenantDataSourceConfigRespDTO; +import com.iailab.module.system.convert.tenant.TenantConvert; +import com.iailab.module.system.dal.dataobject.tenant.TenantDO; import com.iailab.module.system.service.tenant.TenantService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -17,6 +21,9 @@ @Resource private TenantService tenantService; + @Resource + private DataSourceConfigServiceApi dataSourceConfigServiceApi; + @Override public CommonResult<List<Long>> getTenantIdList() { return success(tenantService.getTenantIdList()); @@ -28,4 +35,15 @@ return success(true); } + @Override + public TenantDataSourceConfigRespDTO getTenantDataSourceConfig(Long tenantId) { + // 获得租户信息 + TenantDO tenant = tenantService.getTenant(tenantId); + if (tenant == null) { + return null; + } + // 获得租户的数据源配置 + return TenantConvert.INSTANCE.convert( + dataSourceConfigServiceApi.getDataSourceConfig(tenant.getDataSourceConfigId())); + } } -- Gitblit v1.9.3