|
@@ -12,6 +12,7 @@ import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.SecurityUtils;
|
|
import com.fs.common.utils.SecurityUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.fs.framework.datasource.TenantDataSourceContextHelper;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import com.fs.tenant.config.service.TenantSysConfigService;
|
|
import com.fs.tenant.config.service.TenantSysConfigService;
|
|
@@ -34,6 +35,8 @@ public class SysConfigController extends BaseController {
|
|
|
private TenantSysConfigService tenantSysConfigService;
|
|
private TenantSysConfigService tenantSysConfigService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
public RedisCache redisCache;
|
|
public RedisCache redisCache;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private TenantDataSourceContextHelper tenantContextHelper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取参数配置列表
|
|
* 获取参数配置列表
|
|
@@ -129,7 +132,14 @@ public class SysConfigController extends BaseController {
|
|
|
@GetMapping(value = "/getConfigByKey/{configKey:.+}")
|
|
@GetMapping(value = "/getConfigByKey/{configKey:.+}")
|
|
|
public AjaxResult getConfigByKey(@PathVariable String configKey,
|
|
public AjaxResult getConfigByKey(@PathVariable String configKey,
|
|
|
@RequestParam(value = "tenantId", required = false) Long tenantId) {
|
|
@RequestParam(value = "tenantId", required = false) Long tenantId) {
|
|
|
- return AjaxResult.success(tenantSysConfigService.getConfigByKey(tenantId, configKey));
|
|
|
|
|
|
|
+ SysConfig configByKey;
|
|
|
|
|
+ if (tenantId == null) {
|
|
|
|
|
+ configByKey = tenantSysConfigService.getConfigByKey(configKey);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ configByKey = tenantContextHelper.executeInTenant(tenantId, () -> tenantSysConfigService.getConfigByKey(configKey));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success(configByKey);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|