feat: 添加 spring-boot-desensitize starter.
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user