feat: 添加 spring-boot-desensitize starter.
This commit is contained in:
@@ -97,6 +97,16 @@
|
||||
<artifactId>orion-ops-spring-boot-starter-redis</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orion.ops</groupId>
|
||||
<artifactId>orion-ops-spring-boot-starter-desensitize</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orion.ops</groupId>
|
||||
<artifactId>orion-ops-spring-boot-starter-log</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- websocket -->
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.orion.ops.framework.common.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 脱敏配置元注解
|
||||
* <p>
|
||||
* 标注在字段上则标记脱敏配置
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/29 16:58
|
||||
*/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Desensitize {
|
||||
|
||||
/**
|
||||
* @return 起始保留字符数
|
||||
*/
|
||||
int keepStart() default 0;
|
||||
|
||||
/**
|
||||
* @return 结束保留字符数
|
||||
*/
|
||||
int keepEnd() default 0;
|
||||
|
||||
/**
|
||||
* @return 脱敏字符
|
||||
*/
|
||||
char replacer() default '*';
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.orion.ops.framework.common.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 脱敏配置元注解
|
||||
* <p>
|
||||
* 标注在方法上则标记过滤开启
|
||||
* 多层对象脱敏需要在字段上标注
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/29 16:58
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DoDesensitize {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.orion.ops.framework.common.constant;
|
||||
|
||||
/**
|
||||
* 结果增强器 排序常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2023/6/29 16:09
|
||||
*/
|
||||
public interface ResponseAdviceOrderConst {
|
||||
|
||||
int DESENSITIZE = Integer.MIN_VALUE + 2000;
|
||||
|
||||
int WRAPPER = Integer.MIN_VALUE + 3000;
|
||||
|
||||
}
|
||||
@@ -25,6 +25,8 @@
|
||||
<module>orion-ops-spring-boot-starter-job</module>
|
||||
<module>orion-ops-spring-boot-starter-websocket</module>
|
||||
<module>orion-ops-spring-boot-starter-redis</module>
|
||||
<module>orion-ops-spring-boot-starter-desensitize</module>
|
||||
<module>orion-ops-spring-boot-starter-log</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
@@ -56,6 +56,14 @@
|
||||
<groupId>com.orion.ops</groupId>
|
||||
<artifactId>orion-ops-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orion.ops</groupId>
|
||||
<artifactId>orion-ops-spring-boot-starter-desensitize</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.orion.ops</groupId>
|
||||
<artifactId>orion-ops-spring-boot-starter-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- orion-ops biz-modules -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user