From 0763c720d2a5ba4f91cd3cbea6d8d8575eead5a4 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 21 Jan 2023 13:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=84=B1=E6=95=8F=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../desensitize/core/regex/annotation/EmailDesensitize.java | 2 +- .../desensitize/core/slider/annotation/BankCardDesensitize.java | 2 +- .../core/slider/annotation/CarLicenseDesensitize.java | 2 +- .../core/slider/annotation/FixedPhoneDesensitize.java | 2 +- .../desensitize/core/slider/annotation/IdCardDesensitize.java | 2 +- .../desensitize/core/slider/annotation/MobileDesensitize.java | 2 +- .../desensitize/core/slider/annotation/PasswordDesensitize.java | 2 +- .../desensitize/core/slider/annotation/SliderDesensitize.java | 1 + ...onHandler.java => AbstractSliderDesensitizationHandler.java} | 2 +- .../core/slider/handler/BankCardDesensitization.java | 2 +- .../core/slider/handler/CarLicenseDesensitization.java | 2 +- .../core/slider/handler/ChineseNameDesensitization.java | 2 +- .../core/slider/handler/DefaultDesensitizationHandler.java | 2 +- .../core/slider/handler/FixedPhoneDesensitization.java | 2 +- .../desensitize/core/slider/handler/IdCardDesensitization.java | 2 +- .../desensitize/core/slider/handler/MobileDesensitization.java | 2 +- .../core/slider/handler/PasswordDesensitization.java | 2 +- 17 files changed, 17 insertions(+), 16 deletions(-) rename yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/{AbstractDesensitizationHandler.java => AbstractSliderDesensitizationHandler.java} (96%) diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java index 2e7ae3498..227f25499 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java @@ -30,7 +30,7 @@ public @interface EmailDesensitize { /** * 替换规则,邮箱; * - * 比如:example@gmail.com 脱敏之后 为e****@gmail.com + * 比如:example@gmail.com 脱敏之后为 e****@gmail.com */ String replacer() default "$1****$2"; } diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java index ca04b2b13..19ad54e25 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java @@ -33,7 +33,7 @@ public @interface BankCardDesensitize { int suffixKeep() default 2; /** - * 替换规则,银行卡号;比如:9988002866797031脱敏之后为998800********31 + * 替换规则,银行卡号; 比如:9988002866797031 脱敏之后为 998800********31 */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java index 82a99db20..9000e1ec4 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java @@ -33,7 +33,7 @@ public @interface CarLicenseDesensitize { int suffixKeep() default 1; /** - * 替换规则,车牌号;比如:粤A66666脱敏之后为粤A6***6 + * 替换规则,车牌号;比如:粤A66666 脱敏之后为粤A6***6 */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java index e847954ca..862235346 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java @@ -33,7 +33,7 @@ public @interface FixedPhoneDesensitize { int suffixKeep() default 2; /** - * 替换规则,固定电话;比如:01086551122脱敏之后为0108*****22 + * 替换规则,固定电话;比如:01086551122 脱敏之后为 0108*****22 */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java index 05fb73ab9..8a654c915 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java @@ -33,7 +33,7 @@ public @interface IdCardDesensitize { int suffixKeep() default 2; /** - * 替换规则,身份证号码;比如:530321199204074611脱敏之后为530321**********11 + * 替换规则,身份证号码;比如:530321199204074611 脱敏之后为 530321**********11 */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java index 90dbcacc7..f0c42f192 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java @@ -33,7 +33,7 @@ public @interface MobileDesensitize { int suffixKeep() default 4; /** - * 替换规则,手机号;比如:13248765917脱敏之后为132****5917 + * 替换规则,手机号;比如:13248765917 脱敏之后为 132****5917 */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java index 99ca5d12c..6a3b2694f 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java @@ -35,7 +35,7 @@ public @interface PasswordDesensitize { /** * 替换规则,密码; * - * 比如:123456脱敏之后为****** + * 比如:123456 脱敏之后为 ****** */ String replacer() default "*"; diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java index e13e9c47c..ec79635b9 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java @@ -29,6 +29,7 @@ public @interface SliderDesensitize { /** * 替换规则,会将前缀后缀保留后,全部替换成 replacer + * * 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*"; * 原始字符串 123456 * 脱敏后 1***56 diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractDesensitizationHandler.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractSliderDesensitizationHandler.java similarity index 96% rename from yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractDesensitizationHandler.java rename to yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractSliderDesensitizationHandler.java index e41c57319..7dd2a7fd1 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractDesensitizationHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractSliderDesensitizationHandler.java @@ -9,7 +9,7 @@ import java.lang.annotation.Annotation; * * @author gaibu */ -public abstract class AbstractDesensitizationHandler +public abstract class AbstractSliderDesensitizationHandler implements DesensitizationHandler { @Override diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java index 1447f1a38..e1d90ea6d 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCardDes * * @author gaibu */ -public class BankCardDesensitization extends AbstractDesensitizationHandler { +public class BankCardDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(BankCardDesensitize annotation) { diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java index 3b10ef7ef..34b3e9a69 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseD * * @author gaibu */ -public class CarLicenseDesensitization extends AbstractDesensitizationHandler { +public class CarLicenseDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(CarLicenseDesensitize annotation) { return annotation.prefixKeep(); diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java index f75984dfa..f71dac0e0 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseName * * @author gaibu */ -public class ChineseNameDesensitization extends AbstractDesensitizationHandler { +public class ChineseNameDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(ChineseNameDesensitize annotation) { diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java index 1a114624b..8b0adaeab 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesen * * @author gaibu */ -public class DefaultDesensitizationHandler extends AbstractDesensitizationHandler { +public class DefaultDesensitizationHandler extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(SliderDesensitize annotation) { return annotation.prefixKeep(); diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java index c617e46d3..6e2326171 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneD * * @author gaibu */ -public class FixedPhoneDesensitization extends AbstractDesensitizationHandler { +public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(FixedPhoneDesensitize annotation) { return annotation.prefixKeep(); diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java index 35db2ccd9..9d525b34c 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCardDesen * * @author gaibu */ -public class IdCardDesensitization extends AbstractDesensitizationHandler { +public class IdCardDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(IdCardDesensitize annotation) { return annotation.prefixKeep(); diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java index 6c31606c5..582900ad4 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesen * * @author gaibu */ -public class MobileDesensitization extends AbstractDesensitizationHandler { +public class MobileDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(MobileDesensitize annotation) { diff --git a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java index 16013f87b..1bccaa2a4 100644 --- a/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java +++ b/yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java @@ -7,7 +7,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.PasswordDes * * @author gaibu */ -public class PasswordDesensitization extends AbstractDesensitizationHandler { +public class PasswordDesensitization extends AbstractSliderDesensitizationHandler { @Override Integer getPrefixKeep(PasswordDesensitize annotation) { return annotation.prefixKeep();