2. tenant 组件:feign 调用时,通过 header 透传 Tenant 信息

This commit is contained in:
YunaiV
2022-06-11 23:13:58 +08:00
parent ca6e7a4528
commit f08fe24174
17 changed files with 126 additions and 19 deletions

View File

@@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.infra.enums;
import cn.iocoder.yudao.framework.common.enums.RpcConstants;
/**
* API 相关的枚举
*
@@ -14,7 +16,7 @@ public class ApiConstants {
*/
public static final String NAME = "infra-server";
public static final String PREFIX = "/rpc-api/system";
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/system";
public static final String VERSION = "1.0.0";

View File

@@ -42,6 +42,10 @@
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
</dependency>
<dependency>
<groupId>cn.iocoder.cloud</groupId>
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>

View File

@@ -1,15 +1,12 @@
package cn.iocoder.yudao.module.infra.framework;
import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService;
import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiAccessLogCreateReqDTO;
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO;
import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO;
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.List;
import java.util.concurrent.Future;
@Configuration
@@ -25,4 +22,19 @@ public class TmpConfiguration {
};
}
@Bean
public TenantFrameworkService tenantFrameworkService() {
return new TenantFrameworkService() {
@Override
public List<Long> getTenantIds() {
return null;
}
@Override
public void validTenant(Long id) {
}
};
}
}