mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
feat: 完善注释
This commit is contained in:
parent
c60f8d6da2
commit
e5ab9b71b6
@ -17,18 +17,15 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = EmailDesensitizationHandler.class) // 邮箱;比如:example@gmail.com脱敏之后为e****@gmail.com
|
||||
@Desensitize(desensitizationBy = EmailDesensitizationHandler.class)
|
||||
public @interface EmailDesensitize {
|
||||
/**
|
||||
* 匹配的正则表达式(默认匹配所有)
|
||||
* 匹配的正则表达式
|
||||
*/
|
||||
String regex() default "(^.)[^@]*(@.*$)";
|
||||
|
||||
/**
|
||||
* 替换规则,会将匹配到的字符串全部替换成 replacer
|
||||
* 例如:regex=123; replacer=******
|
||||
* 原始字符串 123456789
|
||||
* 脱敏后字符串 ******456789
|
||||
* 替换规则,邮箱;比如:example@gmail.com脱敏之后为e****@gmail.com
|
||||
*/
|
||||
String replacer() default "$1****$2";
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = BankCardDesensitization.class)// 银行卡号;比如:9988002866797031脱敏之后为998800********31
|
||||
@Desensitize(desensitizationBy = BankCardDesensitization.class)
|
||||
public @interface BankCard {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface BankCard {
|
||||
int suffixKeep() default 2;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,银行卡号;比如:9988002866797031脱敏之后为998800********31
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = CarLicenseDesensitization.class) // 车牌号;比如:粤A66666脱敏之后为粤A6***6
|
||||
@Desensitize(desensitizationBy = CarLicenseDesensitization.class)
|
||||
public @interface CarLicense {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface CarLicense {
|
||||
int suffixKeep() default 1;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,车牌号;比如:粤A66666脱敏之后为粤A6***6
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = ChineseNameDesensitization.class) // 中文名;比如:刘子豪脱敏之后为刘**
|
||||
@Desensitize(desensitizationBy = ChineseNameDesensitization.class)
|
||||
public @interface ChineseName {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface ChineseName {
|
||||
int suffixKeep() default 0;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,中文名;比如:刘子豪脱敏之后为刘**
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = FixedPhoneDesensitization.class) // 固定电话;比如:01086551122脱敏之后为0108*****22
|
||||
@Desensitize(desensitizationBy = FixedPhoneDesensitization.class)
|
||||
public @interface FixedPhone {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface FixedPhone {
|
||||
int suffixKeep() default 2;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,固定电话;比如:01086551122脱敏之后为0108*****22
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = IdCardDesensitization.class) // 身份证号码;比如:530321199204074611脱敏之后为530321**********11
|
||||
@Desensitize(desensitizationBy = IdCardDesensitization.class)
|
||||
public @interface IdCard {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface IdCard {
|
||||
int suffixKeep() default 2;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,身份证号码;比如:530321199204074611脱敏之后为530321**********11
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = PasswordDesensitization.class) // 密码;比如:123456脱敏之后为******
|
||||
@Desensitize(desensitizationBy = PasswordDesensitization.class)
|
||||
public @interface Password {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface Password {
|
||||
int suffixKeep() default 0;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,密码;比如:123456脱敏之后为******
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
@ -17,7 +17,7 @@ import java.lang.annotation.Target;
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@JacksonAnnotationsInside
|
||||
@Desensitize(desensitizationBy = PhoneNumberDesensitization.class) // 手机号;比如:13248765917脱敏之后为132****5917
|
||||
@Desensitize(desensitizationBy = PhoneNumberDesensitization.class)
|
||||
public @interface PhoneNumber {
|
||||
|
||||
/**
|
||||
@ -31,10 +31,7 @@ public @interface PhoneNumber {
|
||||
int suffixKeep() default 4;
|
||||
|
||||
/**
|
||||
* 替换规则,会将前缀后缀保留后,全部替换成 replacer
|
||||
* 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*";
|
||||
* 原始字符串 123456
|
||||
* 脱敏后 1***56
|
||||
* 替换规则,手机号;比如:13248765917脱敏之后为132****5917
|
||||
*/
|
||||
String replacer() default "*";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user