chore:change name
This commit is contained in:
parent
acc1f417e2
commit
bab35893d0
@ -3,7 +3,7 @@ package com.ensign.crm.framework.common.core;
|
||||
/**
|
||||
* 可生成 Int 数组的接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface IntArrayValuable {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
||||
/**
|
||||
* Key Value 的键值对
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
@ -10,7 +10,7 @@ import java.util.Arrays;
|
||||
/**
|
||||
* 通用状态枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
|
@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
/**
|
||||
* 文档地址
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
|
@ -9,7 +9,7 @@ import java.util.Arrays;
|
||||
/**
|
||||
* 终端的枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
|
@ -5,7 +5,7 @@ package com.ensign.crm.framework.common.enums;
|
||||
*
|
||||
* 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 enums 包下
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface WebFilterOrderEnum {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import com.ensign.crm.framework.common.exception.ErrorCode;
|
||||
* 虽然说,HTTP 响应状态码作为业务使用表达能力偏弱,但是使用在系统层面还是非常不错的
|
||||
* 比较特殊的是,因为之前一直使用 0 作为成功,就不使用 200 啦。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface GlobalErrorCodeConstants {
|
||||
|
||||
|
@ -25,7 +25,7 @@ package com.ensign.crm.framework.common.exception.enums;
|
||||
* 不限制规则。
|
||||
* 一般建议,每个模块自增。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ServiceErrorCodeRange {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import java.util.concurrent.Executors;
|
||||
/**
|
||||
* Cache 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class CacheUtils {
|
||||
|
||||
|
@ -13,7 +13,7 @@ import static com.ensign.crm.framework.common.util.collection.CollectionUtils.co
|
||||
/**
|
||||
* Array 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ArrayUtils {
|
||||
|
||||
|
@ -15,7 +15,7 @@ import static java.util.Arrays.asList;
|
||||
/**
|
||||
* Collection 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class CollectionUtils {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.function.Consumer;
|
||||
/**
|
||||
* Map 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class MapUtils {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Set 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class SetUtils {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
/**
|
||||
* 时间工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class DateUtils {
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
/**
|
||||
* 时间工具类,用于 {@link java.time.LocalDateTime}
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class LocalDateTimeUtils {
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
||||
/**
|
||||
* HTTP 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class HttpUtils {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.io.File;
|
||||
/**
|
||||
* 文件工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class FileUtils {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.io.InputStream;
|
||||
/**
|
||||
* IO 工具类,用于 {@link cn.hutool.core.io.IoUtil} 缺失的方法
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class IoUtils {
|
||||
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||
/**
|
||||
* JSON 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class JsonUtils {
|
||||
|
@ -7,7 +7,7 @@ import org.apache.skywalking.apm.toolkit.trace.TraceContext;
|
||||
*
|
||||
* 考虑到每个 starter 都需要用到该工具类,所以放到 common 模块下的 util 包下
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TracerUtils {
|
||||
|
||||
|
@ -9,7 +9,7 @@ import java.math.RoundingMode;
|
||||
/**
|
||||
* 金额工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class MoneyUtils {
|
||||
|
||||
|
@ -8,7 +8,7 @@ import java.math.BigDecimal;
|
||||
/**
|
||||
* 数字的工具类,补全 {@link cn.hutool.core.util.NumberUtil} 的功能
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class NumberUtils {
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.function.Consumer;
|
||||
* 1. 默认使用 {@link cn.hutool.core.bean.BeanUtil} 作为实现类,虽然不同 bean 工具的性能有差别,但是对绝大多数同学的项目,不用在意这点性能
|
||||
* 2. 针对复杂的对象转换,可以搜参考 AuthConvert 实现,通过 mapstruct + default 配合实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class BeanUtils {
|
||||
|
||||
|
@ -10,7 +10,7 @@ import java.util.function.Consumer;
|
||||
/**
|
||||
* Object 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ObjectUtils {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import static java.util.Collections.singletonList;
|
||||
/**
|
||||
* {@link com.ensign.crm.framework.common.pojo.PageParam} 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class PageUtils {
|
||||
|
||||
|
@ -19,7 +19,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 客户端工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ServletUtils {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Spring 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class SpringUtils extends SpringUtil {
|
||||
|
||||
|
@ -13,7 +13,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 字符串工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class StrUtils {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* 校验工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ValidationUtils {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* 数据权限的自动配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class EnsignDataPermissionAutoConfiguration {
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||
/**
|
||||
* 基于部门的数据权限 AutoConfiguration
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass(LoginUser.class)
|
||||
|
@ -8,7 +8,7 @@ import java.lang.annotation.*;
|
||||
* 数据权限注解
|
||||
* 可声明在类或者方法上,标识使用的数据权限规则
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
|
||||
/**
|
||||
* {@link com.ensign.crm.framework.datapermission.core.annotation.DataPermission} 注解的 Advisor 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Getter
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -16,7 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* 1. 在执行方法前,将 @DataPermission 注解入栈
|
||||
* 2. 在执行方法后,将 @DataPermission 注解出栈
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@DataPermission // 该注解,用于 {@link DATA_PERMISSION_NULL} 的空对象
|
||||
public class DataPermissionAnnotationInterceptor implements MethodInterceptor {
|
||||
|
@ -9,7 +9,7 @@ import java.util.List;
|
||||
/**
|
||||
* {@link DataPermission} 注解的 Context 上下文
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class DataPermissionContextHolder {
|
||||
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||
* 它的底层,是基于 MyBatis Plus 的 <a href="https://baomidou.com/plugins/data-permission/">数据权限插件</a>
|
||||
* 核心原理:它会在 SQL 执行前拦截 SQL 语句,并根据用户权限动态添加权限相关的 SQL 片段。这样,只有用户有权限访问的数据才会被查询出来
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class DataPermissionRuleHandler implements MultiDataPermissionHandler {
|
||||
|
@ -10,7 +10,7 @@ import java.util.Set;
|
||||
* 数据权限规则接口
|
||||
* 通过实现接口,自定义数据规则。例如说,
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface DataPermissionRule {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import java.util.List;
|
||||
* {@link DataPermissionRule} 工厂接口
|
||||
* 作为 {@link DataPermissionRule} 的容器,提供管理能力
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface DataPermissionRuleFactory {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
* 默认的 DataPermissionRuleFactoryImpl 实现类
|
||||
* 支持通过 {@link DataPermissionContextHolder} 过滤数据权限
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class DataPermissionRuleFactoryImpl implements DataPermissionRuleFactory {
|
||||
|
@ -42,7 +42,7 @@ import java.util.Set;
|
||||
* 3)想要保证原 dept_id 和 user_id 都可以看的到,此时使用 dept_id 和 user_id 一起过滤;
|
||||
* 最终过滤条件是 WHERE dept_id = ? OR user_id IN (?, ?, ? ...)
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
|
@ -3,7 +3,7 @@ package com.ensign.crm.framework.datapermission.core.rule.dept;
|
||||
/**
|
||||
* {@link DeptDataPermissionRule} 的自定义配置接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface DeptDataPermissionRuleCustomizer {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 基于部门的数据权限规则
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
package com.ensign.crm.framework.datapermission.core.rule.dept;
|
||||
|
@ -9,7 +9,7 @@ import java.util.concurrent.Callable;
|
||||
/**
|
||||
* 数据权限 Util
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class DataPermissionUtils {
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.List;
|
||||
*
|
||||
* 数据可见 resources/area.csv 文件
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
@ -9,7 +9,7 @@ import java.util.Arrays;
|
||||
/**
|
||||
* 区域类型枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
|
@ -22,7 +22,7 @@ import static com.ensign.crm.framework.common.util.collection.CollectionUtils.fi
|
||||
/**
|
||||
* 区域工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class AreaUtils {
|
||||
|
@ -6,6 +6,6 @@
|
||||
* 2. 城市功能:查询城市编码对应的城市信息
|
||||
* 基于 https://github.com/modood/Administrative-divisions-of-China 实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
package com.ensign.crm.framework.ip;
|
||||
|
@ -9,7 +9,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 多租户配置
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "ensign.tenant")
|
||||
@Data
|
||||
|
@ -9,7 +9,7 @@ import java.lang.annotation.*;
|
||||
* 1、Redis 场景:因为是基于 Key 实现多租户的能力,所以忽略没有意义,不像 DB 是一个 column 实现的
|
||||
* 2、MQ 场景:有点难以抉择,目前可以通过 Consumer 手动在消费的方法上,添加 @TenantIgnore 进行忽略
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
@ -14,7 +14,7 @@ import org.aspectj.lang.annotation.Aspect;
|
||||
*
|
||||
* 整体逻辑的实现,和 {@link TenantUtils#executeIgnore(Runnable)} 需要保持一致
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Aspect
|
||||
@Slf4j
|
||||
|
@ -6,7 +6,7 @@ import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
/**
|
||||
* 多租户上下文 Holder
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantContextHolder {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
/**
|
||||
* 拓展多租户的 BaseDO 基类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -13,7 +13,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 基于 MyBatis Plus 多租户的功能,实现 DB 层面的多租户的功能
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantDatabaseInterceptor implements TenantLineHandler {
|
||||
|
||||
|
@ -21,7 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
*
|
||||
* 注意,需要保证 JobHandler 的幂等性。因为 Job 因为某个租户执行失败重试时,之前执行成功的租户也会再次执行。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Aspect
|
||||
@RequiredArgsConstructor
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
||||
*
|
||||
* Kafka Producer 发送消息时,增加 {@link TenantKafkaProducerInterceptor} 拦截器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class TenantKafkaEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
@ -18,7 +18,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
|
||||
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantKafkaProducerInterceptor implements ProducerInterceptor<Object, Object> {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
/**
|
||||
* 多租户的 RabbitMQ 初始化器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRabbitMQInitializer implements BeanPostProcessor {
|
||||
|
||||
|
@ -15,7 +15,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
|
||||
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRabbitMQMessagePostProcessor implements MessagePostProcessor {
|
||||
|
||||
|
@ -13,7 +13,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
* 1. Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
|
||||
* 2. Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRedisMessageInterceptor implements RedisMessageInterceptor {
|
||||
|
||||
|
@ -17,7 +17,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
*
|
||||
* Consumer 消费消息时,将消息的 Header 的租户编号,添加到 {@link TenantContextHolder} 中,通过 {@link InvocableHandlerMethod} 实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRocketMQConsumeMessageHook implements ConsumeMessageHook {
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
/**
|
||||
* 多租户的 RocketMQ 初始化器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRocketMQInitializer implements BeanPostProcessor {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
*
|
||||
* Producer 发送消息时,将 {@link TenantContextHolder} 租户编号,添加到消息的 Header 中
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantRocketMQSendMessageHook implements SendMessageHook {
|
||||
|
||||
|
@ -28,7 +28,7 @@ import java.util.Objects;
|
||||
* 2. 如果请求未带租户的编号,检查是否是忽略的 URL,否则也不允许访问。
|
||||
* 3. 校验租户是合法,例如说被禁用、到期
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class TenantSecurityWebFilter extends ApiRequestFilter {
|
||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
||||
/**
|
||||
* Tenant 框架 Service 接口,定义获取租户信息
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface TenantFrameworkService {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
||||
/**
|
||||
* Tenant 框架 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class TenantFrameworkServiceImpl implements TenantFrameworkService {
|
||||
|
@ -10,7 +10,7 @@ import static com.ensign.crm.framework.web.core.util.WebFrameworkUtils.HEADER_TE
|
||||
/**
|
||||
* 多租户 Util
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantUtils {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.io.IOException;
|
||||
* 多租户 Context Web 过滤器
|
||||
* 将请求 Header 中的 tenant-id 解析出来,添加到 {@link TenantContextHolder} 中,这样后续的 DB 等操作,可以获得到租户编号。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TenantContextWebFilter extends OncePerRequestFilter {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* 字典工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class DictFrameworkUtils {
|
||||
|
@ -14,7 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
/**
|
||||
* Excel 数据字典转换器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class DictConvert implements Converter<Object> {
|
||||
|
@ -10,7 +10,7 @@ import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
/**
|
||||
* Excel Json 转换器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class JsonConvert implements Converter<Object> {
|
||||
|
||||
|
@ -14,7 +14,7 @@ import java.math.RoundingMode;
|
||||
*
|
||||
* 金额单位:分
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class MoneyConvert implements Converter<Integer> {
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.List;
|
||||
/**
|
||||
* Excel 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class ExcelUtils {
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.ensign.crm.framework.quartz.core.handler;
|
||||
/**
|
||||
* 任务处理器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface JobHandler {
|
||||
|
||||
|
@ -22,7 +22,7 @@ import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage;
|
||||
/**
|
||||
* 基础 Job 调用者,负责调用 {@link JobHandler#execute(String)} 执行任务
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@DisallowConcurrentExecution
|
||||
@PersistJobDataAfterExecution
|
||||
|
@ -16,7 +16,7 @@ import static com.ensign.crm.framework.common.exception.util.ServiceExceptionUti
|
||||
*
|
||||
* 另外,jobHandlerName 对应到 Spring Bean 的名字,直接调用
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class SchedulerManager {
|
||||
|
||||
|
@ -7,7 +7,7 @@ import java.time.LocalDateTime;
|
||||
/**
|
||||
* Job 日志 Framework Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface JobLogFrameworkService {
|
||||
|
||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
||||
/**
|
||||
* Quartz Cron 表达式的工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class CronUtils {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.context.annotation.Bean;
|
||||
/**
|
||||
* Metrics 配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass({MeterRegistryCustomizer.class})
|
||||
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Trace 过滤器,打印 traceId 到 header 中返回
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TraceFilter extends OncePerRequestFilter {
|
||||
|
||||
|
@ -11,7 +11,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 链路追踪 Util
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class TracerFrameworkUtils {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 使用 SkyWalking 组件,作为链路追踪、日志中心。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
package com.ensign.crm.framework.tracer;
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.context.annotation.Bean;
|
||||
/**
|
||||
* RabbitMQ 消息队列配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@Slf4j
|
||||
|
@ -33,7 +33,7 @@ import java.util.Properties;
|
||||
/**
|
||||
* Redis 消息队列 Consumer 配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
@EnableScheduling // 启用定时任务,用于 RedisPendingMessageResendJob 重发消息
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
/**
|
||||
* Redis 消息队列 Producer 配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
@AutoConfiguration(after = EnsignRedisAutoConfiguration.class)
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||
/**
|
||||
* Redis MQ 操作模板类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class RedisMQTemplate {
|
||||
|
@ -7,7 +7,7 @@ import com.ensign.crm.framework.mq.redis.core.message.AbstractRedisMessage;
|
||||
* 通过拦截器,作为插件机制,实现拓展。
|
||||
* 例如说,多租户场景下的 MQ 消息处理
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public interface RedisMessageInterceptor {
|
||||
|
||||
|
@ -8,7 +8,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Redis 消息抽象基类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Data
|
||||
public abstract class AbstractRedisMessage {
|
||||
|
@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
/**
|
||||
* Redis Channel Message 抽象类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public abstract class AbstractRedisChannelMessage extends AbstractRedisMessage {
|
||||
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||
*
|
||||
* @param <T> 消息类型。一定要填写噢,不然会报错
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public abstract class AbstractRedisChannelMessageListener<T extends AbstractRedisChannelMessage> implements MessageListener {
|
||||
|
||||
|
@ -6,7 +6,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
/**
|
||||
* Redis Stream Message 抽象类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public abstract class AbstractRedisStreamMessage extends AbstractRedisMessage {
|
||||
|
||||
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||
*
|
||||
* @param <T> 消息类型。一定要填写噢,不然会报错
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public abstract class AbstractRedisStreamMessageListener<T extends AbstractRedisStreamMessage>
|
||||
implements StreamListener<String, ObjectRecord<String, String>> {
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
/**
|
||||
* 数据库配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableTransactionManagement(proxyTargetClass = true) // 启动事务管理
|
||||
|
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Druid 底部广告过滤器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class DruidAdRemoveFilter extends OncePerRequestFilter {
|
||||
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
||||
/**
|
||||
* MyBaits 配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@AutoConfiguration(before = MybatisPlusAutoConfiguration.class) // 目的:先于 MyBatis Plus 自动配置,避免 @MapperScan 可能扫描不到 Mapper 打印 warn 日志
|
||||
@MapperScan(value = "${ensign.info.base-package}", annotationClass = Mapper.class,
|
||||
|
@ -16,7 +16,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 当 IdType 为 {@link IdType#NONE} 时,根据 PRIMARY 数据源所使用的数据库,自动设置
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Slf4j
|
||||
public class IdTypeEnvironmentPostProcessor implements EnvironmentPostProcessor {
|
||||
|
@ -17,7 +17,7 @@ import java.time.LocalDateTime;
|
||||
* 为什么实现 {@link TransPojo} 接口?
|
||||
* 因为使用 Easy-Trans TransType.SIMPLE 模式,集成 MyBatis Plus 查询
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(value = "transMap") // 由于 Easy-Trans 会添加 transMap 属性,避免 Jackson 在 Spring Cache 反序列化报错
|
||||
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.DbType;
|
||||
/**
|
||||
* SQL相关常量类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class SqlConstants {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.sql.SQLException;
|
||||
* 字段字段的 TypeHandler 实现类,基于 {@link cn.hutool.crypto.symmetric.AES} 实现
|
||||
* 可通过 jasypt.encryptor.password 配置项,设置密钥
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class EncryptTypeHandler extends BaseTypeHandler<String> {
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
/**
|
||||
* List<Long> 的类型转换器实现类,对应数据库的 varchar 类型
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
@MappedJdbcTypes(JdbcType.VARCHAR)
|
||||
@MappedTypes(List.class)
|
||||
|
@ -13,7 +13,7 @@ import java.sql.SQLException;
|
||||
/**
|
||||
* JDBC 工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ENSIGN
|
||||
*/
|
||||
public class JdbcUtils {
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user