【修改】 名称替换

This commit is contained in:
DESKTOP-932OMT8\REN
2025-05-21 17:28:26 +08:00
parent 3bd8a424ec
commit b5f18ba897
1212 changed files with 1262 additions and 1270 deletions

View File

@@ -9,7 +9,7 @@ import java.util.Set;
/**
* 多租户配置
*
* @author 芋道源码
* @author 朋辰
*/
@ConfigurationProperties(prefix = "exam.tenant")
@Data

View File

@@ -9,7 +9,7 @@ import java.lang.annotation.*;
* 1、Redis 场景:因为是基于 Key 实现多租户的能力,所以忽略没有意义,不像 DB 是一个 column 实现的
* 2、MQ 场景:有点难以抉择,目前可以通过 Consumer 手动在消费的方法上,添加 @TenantIgnore 进行忽略
*
* @author 芋道源码
* @author 朋辰
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)

View File

@@ -14,7 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
*
* 整体逻辑的实现,和 {@link TenantUtils#executeIgnore(Runnable)} 需要保持一致
*
* @author 芋道源码
* @author 朋辰
*/
@Aspect
@Slf4j

View File

@@ -6,7 +6,7 @@ import com.alibaba.ttl.TransmittableThreadLocal;
/**
* 多租户上下文 Holder
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantContextHolder {

View File

@@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
/**
* 拓展多租户的 BaseDO 基类
*
* @author 芋道源码
* @author 朋辰
*/
@Data
@EqualsAndHashCode(callSuper = true)

View File

@@ -14,7 +14,7 @@ import java.util.Set;
/**
* 基于 MyBatis Plus 多租户的功能,实现 DB 层面的多租户的功能
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantDatabaseInterceptor implements TenantLineHandler {

View File

@@ -22,7 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
*
* 注意,需要保证 JobHandler 的幂等性。因为 Job 因为某个租户执行失败重试时,之前执行成功的租户也会再次执行。
*
* @author 芋道源码
* @author 朋辰
*/
@Aspect
@RequiredArgsConstructor

View File

@@ -11,7 +11,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
*
* Kafka Producer 发送消息时,增加 {@link TenantKafkaProducerInterceptor} 拦截器
*
* @author 芋道源码
* @author 朋辰
*/
@Slf4j
public class TenantKafkaEnvironmentPostProcessor implements EnvironmentPostProcessor {

View File

@@ -18,7 +18,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantKafkaProducerInterceptor implements ProducerInterceptor<Object, Object> {

View File

@@ -7,7 +7,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
/**
* 多租户的 RabbitMQ 初始化器
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRabbitMQInitializer implements BeanPostProcessor {

View File

@@ -15,7 +15,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRabbitMQMessagePostProcessor implements MessagePostProcessor {

View File

@@ -13,7 +13,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRedisMessageInterceptor implements RedisMessageInterceptor {

View File

@@ -17,7 +17,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
*
* Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRocketMQConsumeMessageHook implements ConsumeMessageHook {

View File

@@ -12,7 +12,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
/**
* 多租户的 RocketMQ 初始化器
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRocketMQInitializer implements BeanPostProcessor {

View File

@@ -11,7 +11,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
*
* Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantRocketMQSendMessageHook implements SendMessageHook {

View File

@@ -28,7 +28,7 @@ import java.util.Objects;
* 2. 如果请求未带租户的编号,检查是否是忽略的 URL否则也不允许访问。
* 3. 校验租户是合法,例如说被禁用、到期
*
* @author 芋道源码
* @author 朋辰
*/
@Slf4j
public class TenantSecurityWebFilter extends ApiRequestFilter {

View File

@@ -5,7 +5,7 @@ import java.util.List;
/**
* Tenant 框架 Service 接口,定义获取租户信息
*
* @author 芋道源码
* @author 朋辰
*/
public interface TenantFrameworkService {

View File

@@ -14,7 +14,7 @@ import java.util.List;
/**
* Tenant 框架 Service 实现类
*
* @author 芋道源码
* @author 朋辰
*/
@RequiredArgsConstructor
public class TenantFrameworkServiceImpl implements TenantFrameworkService {

View File

@@ -10,7 +10,7 @@ import static pc.exam.pp.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT
/**
* 多租户 Util
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantUtils {

View File

@@ -14,7 +14,7 @@ import java.io.IOException;
* 多租户 Context Web 过滤器
* 将请求 Header 中的 tenant-id 解析出来,添加到 {@link TenantContextHolder} 中,这样后续的 DB 等操作,可以获得到租户编号。
*
* @author 芋道源码
* @author 朋辰
*/
public class TenantContextWebFilter extends OncePerRequestFilter {