feat: 完善注释

pull/2/head
gaibu 2023-01-16 21:50:09 +08:00
parent c60f8d6da2
commit e5ab9b71b6
8 changed files with 17 additions and 41 deletions

View File

@ -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.come****@gmail.com
*/
String replacer() default "$1****$2";
}

View File

@ -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
* ;9988002866797031998800********31
*/
String replacer() default "*";

View File

@ -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
* ;A66666A6***6
*/
String replacer() default "*";

View File

@ -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 "*";

View File

@ -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
* ;010865511220108*****22
*/
String replacer() default "*";

View File

@ -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
* ;530321199204074611530321**********11
*/
String replacer() default "*";

View File

@ -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 "*";

View File

@ -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
* ;13248765917132****5917
*/
String replacer() default "*";