From 6d75723f3e3bd43895db2470bc5fabb2314dbe8b Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 06 一月 2025 13:27:46 +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