Commit 729ec31dab4144ec70be764363213e4d50c0d8c2
1 parent
2aa208f4
feat: 修改脱敏注解名称
Showing
19 changed files
with
82 additions
and
82 deletions
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/Regex.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = DefaultRegexDesensitizationHandler.class) | 22 | @DesensitizeBy(handler = DefaultRegexDesensitizationHandler.class) |
| 23 | -public @interface Regex { | 23 | +public @interface RegexDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 匹配的正则表达式(默认匹配所有) | 26 | * 匹配的正则表达式(默认匹配所有) |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/DefaultRegexDesensitizationHandler.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.regex.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.regex.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.Regex; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.RegexDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link Regex} 的正则脱敏处理器 | 6 | + * {@link RegexDesensitize} 的正则脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class DefaultRegexDesensitizationHandler extends AbstractRegexDesensitizationHandler<Regex> { | 10 | +public class DefaultRegexDesensitizationHandler extends AbstractRegexDesensitizationHandler<RegexDesensitize> { |
| 11 | 11 | ||
| 12 | @Override | 12 | @Override |
| 13 | - String getRegex(Regex annotation) { | 13 | + String getRegex(RegexDesensitize annotation) { |
| 14 | return annotation.regex(); | 14 | return annotation.regex(); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | @Override | 17 | @Override |
| 18 | - String getReplacer(Regex annotation) { | 18 | + String getReplacer(RegexDesensitize annotation) { |
| 19 | return annotation.replacer(); | 19 | return annotation.replacer(); |
| 20 | } | 20 | } |
| 21 | } | 21 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCard.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = BankCardDesensitization.class) | 22 | @DesensitizeBy(handler = BankCardDesensitization.class) |
| 23 | -public @interface BankCard { | 23 | +public @interface BankCardDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicense.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = CarLicenseDesensitization.class) | 22 | @DesensitizeBy(handler = CarLicenseDesensitization.class) |
| 23 | -public @interface CarLicense { | 23 | +public @interface CarLicenseDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/ChineseName.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/ChineseNameDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = ChineseNameDesensitization.class) | 22 | @DesensitizeBy(handler = ChineseNameDesensitization.class) |
| 23 | -public @interface ChineseName { | 23 | +public @interface ChineseNameDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhone.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = FixedPhoneDesensitization.class) | 22 | @DesensitizeBy(handler = FixedPhoneDesensitization.class) |
| 23 | -public @interface FixedPhone { | 23 | +public @interface FixedPhoneDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCard.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = IdCardDesensitization.class) | 22 | @DesensitizeBy(handler = IdCardDesensitization.class) |
| 23 | -public @interface IdCard { | 23 | +public @interface IdCardDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/Mobile.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = MobileDesensitization.class) | 22 | @DesensitizeBy(handler = MobileDesensitization.class) |
| 23 | -public @interface Mobile { | 23 | +public @interface MobileDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/Password.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = PasswordDesensitization.class) | 22 | @DesensitizeBy(handler = PasswordDesensitization.class) |
| 23 | -public @interface Password { | 23 | +public @interface PasswordDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 前缀保留长度 | 26 | * 前缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/Slider.java renamed to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java
| @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | @@ -20,7 +20,7 @@ import java.lang.annotation.Target; | ||
| 20 | @Retention(RetentionPolicy.RUNTIME) | 20 | @Retention(RetentionPolicy.RUNTIME) |
| 21 | @JacksonAnnotationsInside | 21 | @JacksonAnnotationsInside |
| 22 | @DesensitizeBy(handler = DefaultDesensitizationHandler.class) | 22 | @DesensitizeBy(handler = DefaultDesensitizationHandler.class) |
| 23 | -public @interface Slider { | 23 | +public @interface SliderDesensitize { |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 后缀保留长度 | 26 | * 后缀保留长度 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCard; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCardDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link BankCard} 的脱敏处理器 | 6 | + * {@link BankCardDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class BankCardDesensitization extends AbstractDesensitizationHandler<BankCard> { | 10 | +public class BankCardDesensitization extends AbstractDesensitizationHandler<BankCardDesensitize> { |
| 11 | 11 | ||
| 12 | @Override | 12 | @Override |
| 13 | - Integer getPrefixKeep(BankCard annotation) { | 13 | + Integer getPrefixKeep(BankCardDesensitize annotation) { |
| 14 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | @Override | 17 | @Override |
| 18 | - Integer getSuffixKeep(BankCard annotation) { | 18 | + Integer getSuffixKeep(BankCardDesensitize annotation) { |
| 19 | return annotation.suffixKeep(); | 19 | return annotation.suffixKeep(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - String getReplacer(BankCard annotation) { | 23 | + String getReplacer(BankCardDesensitize annotation) { |
| 24 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 25 | } | 25 | } |
| 26 | 26 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicense; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link CarLicense} 的脱敏处理器 | 6 | + * {@link CarLicenseDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class CarLicenseDesensitization extends AbstractDesensitizationHandler<CarLicense> { | 10 | +public class CarLicenseDesensitization extends AbstractDesensitizationHandler<CarLicenseDesensitize> { |
| 11 | @Override | 11 | @Override |
| 12 | - Integer getPrefixKeep(CarLicense annotation) { | 12 | + Integer getPrefixKeep(CarLicenseDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 13 | return annotation.prefixKeep(); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | @Override | 16 | @Override |
| 17 | - Integer getSuffixKeep(CarLicense annotation) { | 17 | + Integer getSuffixKeep(CarLicenseDesensitize annotation) { |
| 18 | return annotation.suffixKeep(); | 18 | return annotation.suffixKeep(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | - String getReplacer(CarLicense annotation) { | 22 | + String getReplacer(CarLicenseDesensitize annotation) { |
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseName; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseNameDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link ChineseName} 的脱敏处理器 | 6 | + * {@link ChineseNameDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class ChineseNameDesensitization extends AbstractDesensitizationHandler<ChineseName> { | 10 | +public class ChineseNameDesensitization extends AbstractDesensitizationHandler<ChineseNameDesensitize> { |
| 11 | 11 | ||
| 12 | @Override | 12 | @Override |
| 13 | - Integer getPrefixKeep(ChineseName annotation) { | 13 | + Integer getPrefixKeep(ChineseNameDesensitize annotation) { |
| 14 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | @Override | 17 | @Override |
| 18 | - Integer getSuffixKeep(ChineseName annotation) { | 18 | + Integer getSuffixKeep(ChineseNameDesensitize annotation) { |
| 19 | return annotation.suffixKeep(); | 19 | return annotation.suffixKeep(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - String getReplacer(ChineseName annotation) { | 23 | + String getReplacer(ChineseNameDesensitize annotation) { |
| 24 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 25 | } | 25 | } |
| 26 | 26 |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Slider; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link Slider} 的脱敏处理器 | 6 | + * {@link SliderDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class DefaultDesensitizationHandler extends AbstractDesensitizationHandler<Slider> { | 10 | +public class DefaultDesensitizationHandler extends AbstractDesensitizationHandler<SliderDesensitize> { |
| 11 | @Override | 11 | @Override |
| 12 | - Integer getPrefixKeep(Slider annotation) { | 12 | + Integer getPrefixKeep(SliderDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 13 | return annotation.prefixKeep(); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | @Override | 16 | @Override |
| 17 | - Integer getSuffixKeep(Slider annotation) { | 17 | + Integer getSuffixKeep(SliderDesensitize annotation) { |
| 18 | return annotation.suffixKeep(); | 18 | return annotation.suffixKeep(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | - String getReplacer(Slider annotation) { | 22 | + String getReplacer(SliderDesensitize annotation) { |
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhone; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link FixedPhone} 的脱敏处理器 | 6 | + * {@link FixedPhoneDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class FixedPhoneDesensitization extends AbstractDesensitizationHandler<FixedPhone> { | 10 | +public class FixedPhoneDesensitization extends AbstractDesensitizationHandler<FixedPhoneDesensitize> { |
| 11 | @Override | 11 | @Override |
| 12 | - Integer getPrefixKeep(FixedPhone annotation) { | 12 | + Integer getPrefixKeep(FixedPhoneDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 13 | return annotation.prefixKeep(); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | @Override | 16 | @Override |
| 17 | - Integer getSuffixKeep(FixedPhone annotation) { | 17 | + Integer getSuffixKeep(FixedPhoneDesensitize annotation) { |
| 18 | return annotation.suffixKeep(); | 18 | return annotation.suffixKeep(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | - String getReplacer(FixedPhone annotation) { | 22 | + String getReplacer(FixedPhoneDesensitize annotation) { |
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCard; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCardDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link IdCard} 的脱敏处理器 | 6 | + * {@link IdCardDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class IdCardDesensitization extends AbstractDesensitizationHandler<IdCard> { | 10 | +public class IdCardDesensitization extends AbstractDesensitizationHandler<IdCardDesensitize> { |
| 11 | @Override | 11 | @Override |
| 12 | - Integer getPrefixKeep(IdCard annotation) { | 12 | + Integer getPrefixKeep(IdCardDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 13 | return annotation.prefixKeep(); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | @Override | 16 | @Override |
| 17 | - Integer getSuffixKeep(IdCard annotation) { | 17 | + Integer getSuffixKeep(IdCardDesensitize annotation) { |
| 18 | return annotation.suffixKeep(); | 18 | return annotation.suffixKeep(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | - String getReplacer(IdCard annotation) { | 22 | + String getReplacer(IdCardDesensitize annotation) { |
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Mobile; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link Mobile} 的脱敏处理器 | 6 | + * {@link MobileDesensitize} 的脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class MobileDesensitization extends AbstractDesensitizationHandler<Mobile> { | 10 | +public class MobileDesensitization extends AbstractDesensitizationHandler<MobileDesensitize> { |
| 11 | 11 | ||
| 12 | @Override | 12 | @Override |
| 13 | - Integer getPrefixKeep(Mobile annotation) { | 13 | + Integer getPrefixKeep(MobileDesensitize annotation) { |
| 14 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | @Override | 17 | @Override |
| 18 | - Integer getSuffixKeep(Mobile annotation) { | 18 | + Integer getSuffixKeep(MobileDesensitize annotation) { |
| 19 | return annotation.suffixKeep(); | 19 | return annotation.suffixKeep(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - String getReplacer(Mobile annotation) { | 23 | + String getReplacer(MobileDesensitize annotation) { |
| 24 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 25 | } | 25 | } |
| 26 | } | 26 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.slider.handler; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Password; | 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.PasswordDesensitize; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - * {@link Password} 的码脱敏处理器 | 6 | + * {@link PasswordDesensitize} 的码脱敏处理器 |
| 7 | * | 7 | * |
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | -public class PasswordDesensitization extends AbstractDesensitizationHandler<Password> { | 10 | +public class PasswordDesensitization extends AbstractDesensitizationHandler<PasswordDesensitize> { |
| 11 | @Override | 11 | @Override |
| 12 | - Integer getPrefixKeep(Password annotation) { | 12 | + Integer getPrefixKeep(PasswordDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 13 | return annotation.prefixKeep(); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | @Override | 16 | @Override |
| 17 | - Integer getSuffixKeep(Password annotation) { | 17 | + Integer getSuffixKeep(PasswordDesensitize annotation) { |
| 18 | return annotation.suffixKeep(); | 18 | return annotation.suffixKeep(); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | @Override | 21 | @Override |
| 22 | - String getReplacer(Password annotation) { | 22 | + String getReplacer(PasswordDesensitize annotation) { |
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | } | 25 | } |
yudao-framework/yudao-spring-boot-starter-desensitize/src/test/java/cn/iocoder/yudao/framework/desensitize/core/DesensitizeTest.java
| @@ -2,16 +2,16 @@ package cn.iocoder.yudao.framework.desensitize.core; | @@ -2,16 +2,16 @@ package cn.iocoder.yudao.framework.desensitize.core; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | 3 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 4 | import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.EmailDesensitize; | 4 | import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.EmailDesensitize; |
| 5 | -import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.Regex; | 5 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.RegexDesensitize; |
| 6 | import cn.iocoder.yudao.framework.desensitize.core.annotation.Address; | 6 | import cn.iocoder.yudao.framework.desensitize.core.annotation.Address; |
| 7 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCard; | ||
| 8 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicense; | ||
| 9 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseName; | ||
| 10 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhone; | ||
| 11 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCard; | ||
| 12 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Password; | ||
| 13 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Mobile; | ||
| 14 | -import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.Slider; | 7 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCardDesensitize; |
| 8 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseDesensitize; | ||
| 9 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseNameDesensitize; | ||
| 10 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneDesensitize; | ||
| 11 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCardDesensitize; | ||
| 12 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.PasswordDesensitize; | ||
| 13 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesensitize; | ||
| 14 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesensitize; | ||
| 15 | import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; | 15 | import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; |
| 16 | import lombok.Data; | 16 | import lombok.Data; |
| 17 | import org.junit.jupiter.api.Test; | 17 | import org.junit.jupiter.api.Test; |
| @@ -65,29 +65,29 @@ public class DesensitizeTest extends BaseMockitoUnitTest { | @@ -65,29 +65,29 @@ public class DesensitizeTest extends BaseMockitoUnitTest { | ||
| 65 | @Data | 65 | @Data |
| 66 | public static class DesensitizeDemo { | 66 | public static class DesensitizeDemo { |
| 67 | 67 | ||
| 68 | - @ChineseName | 68 | + @ChineseNameDesensitize |
| 69 | private String nickname; | 69 | private String nickname; |
| 70 | - @BankCard | 70 | + @BankCardDesensitize |
| 71 | private String bankCard; | 71 | private String bankCard; |
| 72 | - @CarLicense | 72 | + @CarLicenseDesensitize |
| 73 | private String carLicense; | 73 | private String carLicense; |
| 74 | - @FixedPhone | 74 | + @FixedPhoneDesensitize |
| 75 | private String fixedPhone; | 75 | private String fixedPhone; |
| 76 | - @IdCard | 76 | + @IdCardDesensitize |
| 77 | private String idCard; | 77 | private String idCard; |
| 78 | - @Password | 78 | + @PasswordDesensitize |
| 79 | private String password; | 79 | private String password; |
| 80 | - @Mobile | 80 | + @MobileDesensitize |
| 81 | private String phoneNumber; | 81 | private String phoneNumber; |
| 82 | - @Slider(prefixKeep = 6, suffixKeep = 1, replacer = "#") | 82 | + @SliderDesensitize(prefixKeep = 6, suffixKeep = 1, replacer = "#") |
| 83 | private String slider1; | 83 | private String slider1; |
| 84 | - @Slider(prefixKeep = 3, suffixKeep = 3) | 84 | + @SliderDesensitize(prefixKeep = 3, suffixKeep = 3) |
| 85 | private String slider2; | 85 | private String slider2; |
| 86 | - @Slider(prefixKeep = 10) | 86 | + @SliderDesensitize(prefixKeep = 10) |
| 87 | private String slider3; | 87 | private String slider3; |
| 88 | @EmailDesensitize | 88 | @EmailDesensitize |
| 89 | private String email; | 89 | private String email; |
| 90 | - @Regex(regex = "芋道源码", replacer = "*") | 90 | + @RegexDesensitize(regex = "芋道源码", replacer = "*") |
| 91 | private String regex; | 91 | private String regex; |
| 92 | @Address | 92 | @Address |
| 93 | private String address; | 93 | private String address; |