Commit 7ba3b123131bdd792bbca9e46e7a7497895e101e
1 parent
8c2b8ed8
【优化】数据脱敏支持 Spring el 表达式,支持根据权限控制脱敏
Showing
24 changed files
with
81 additions
and
87 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/spring/SpringExpressionUtils.java
| @@ -4,9 +4,9 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,9 +4,9 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.map.MapUtil; | 4 | import cn.hutool.core.map.MapUtil; |
| 5 | import cn.hutool.core.util.ArrayUtil; | 5 | import cn.hutool.core.util.ArrayUtil; |
| 6 | import cn.hutool.core.util.StrUtil; | 6 | import cn.hutool.core.util.StrUtil; |
| 7 | +import cn.hutool.extra.spring.SpringUtil; | ||
| 7 | import org.aspectj.lang.JoinPoint; | 8 | import org.aspectj.lang.JoinPoint; |
| 8 | import org.aspectj.lang.reflect.MethodSignature; | 9 | import org.aspectj.lang.reflect.MethodSignature; |
| 9 | -import org.springframework.beans.factory.BeanFactory; | ||
| 10 | import org.springframework.context.expression.BeanFactoryResolver; | 10 | import org.springframework.context.expression.BeanFactoryResolver; |
| 11 | import org.springframework.core.DefaultParameterNameDiscoverer; | 11 | import org.springframework.core.DefaultParameterNameDiscoverer; |
| 12 | import org.springframework.core.ParameterNameDiscoverer; | 12 | import org.springframework.core.ParameterNameDiscoverer; |
| @@ -93,17 +93,16 @@ public class SpringExpressionUtils { | @@ -93,17 +93,16 @@ public class SpringExpressionUtils { | ||
| 93 | /** | 93 | /** |
| 94 | * 从 Bean 工厂,解析 EL 表达式的结果 | 94 | * 从 Bean 工厂,解析 EL 表达式的结果 |
| 95 | * | 95 | * |
| 96 | - * @param beanFactory Bean 工程 | ||
| 97 | * @param expressionString EL 表达式 | 96 | * @param expressionString EL 表达式 |
| 98 | * @return 执行界面 | 97 | * @return 执行界面 |
| 99 | */ | 98 | */ |
| 100 | - public static Object parseExpression(BeanFactory beanFactory, String expressionString) { | 99 | + public static Object parseExpression(String expressionString) { |
| 101 | if (StrUtil.isBlank(expressionString)) { | 100 | if (StrUtil.isBlank(expressionString)) { |
| 102 | return null; | 101 | return null; |
| 103 | } | 102 | } |
| 104 | Expression expression = EXPRESSION_PARSER.parseExpression(expressionString); | 103 | Expression expression = EXPRESSION_PARSER.parseExpression(expressionString); |
| 105 | StandardEvaluationContext context = new StandardEvaluationContext(); | 104 | StandardEvaluationContext context = new StandardEvaluationContext(); |
| 106 | - context.setBeanResolver(new BeanFactoryResolver(beanFactory)); | 105 | + context.setBeanResolver(new BeanFactoryResolver(SpringUtil.getApplicationContext())); |
| 107 | return expression.getValue(context); | 106 | return expression.getValue(context); |
| 108 | } | 107 | } |
| 109 | 108 |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/handler/DesensitizationHandler.java
| 1 | package cn.iocoder.yudao.framework.desensitize.core.base.handler; | 1 | package cn.iocoder.yudao.framework.desensitize.core.base.handler; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.util.ReflectUtil; | ||
| 4 | + | ||
| 3 | import java.lang.annotation.Annotation; | 5 | import java.lang.annotation.Annotation; |
| 4 | 6 | ||
| 5 | /** | 7 | /** |
| @@ -18,4 +20,21 @@ public interface DesensitizationHandler<T extends Annotation> { | @@ -18,4 +20,21 @@ public interface DesensitizationHandler<T extends Annotation> { | ||
| 18 | */ | 20 | */ |
| 19 | String desensitize(String origin, T annotation); | 21 | String desensitize(String origin, T annotation); |
| 20 | 22 | ||
| 23 | + /** | ||
| 24 | + * 是否禁用脱敏的 Spring EL 表达式 | ||
| 25 | + * | ||
| 26 | + * 如果返回 true 则跳过脱敏 | ||
| 27 | + * | ||
| 28 | + * @param annotation 注解信息 | ||
| 29 | + * @return 是否禁用脱敏的 Spring EL 表达式 | ||
| 30 | + */ | ||
| 31 | + default String getDisable(T annotation) { | ||
| 32 | + // 约定:默认就是 enable() 属性。如果不符合,子类重写 | ||
| 33 | + try { | ||
| 34 | + return (String) ReflectUtil.invoke(annotation, "disable"); | ||
| 35 | + } catch (Exception ex) { | ||
| 36 | + return ""; | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + | ||
| 21 | } | 40 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java
| @@ -35,8 +35,10 @@ public @interface EmailDesensitize { | @@ -35,8 +35,10 @@ public @interface EmailDesensitize { | ||
| 35 | String replacer() default "$1****$2"; | 35 | String replacer() default "$1****$2"; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 38 | + * 是否禁用脱敏 |
| 39 | + * | ||
| 40 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 39 | */ | 41 | */ |
| 40 | - String condition() default ""; | 42 | + String disable() default ""; |
| 41 | 43 | ||
| 42 | } | 44 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java
| @@ -37,8 +37,10 @@ public @interface RegexDesensitize { | @@ -37,8 +37,10 @@ public @interface RegexDesensitize { | ||
| 37 | String replacer() default "******"; | 37 | String replacer() default "******"; |
| 38 | 38 | ||
| 39 | /** | 39 | /** |
| 40 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 40 | + * 是否禁用脱敏 |
| 41 | + * | ||
| 42 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 41 | */ | 43 | */ |
| 42 | - String condition() default ""; | 44 | + String disable() default ""; |
| 43 | 45 | ||
| 44 | } | 46 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/AbstractRegexDesensitizationHandler.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.hutool.extra.spring.SpringUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils; | 3 | import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils; |
| 5 | import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | 4 | import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; |
| 6 | 5 | ||
| @@ -16,10 +15,13 @@ public abstract class AbstractRegexDesensitizationHandler<T extends Annotation> | @@ -16,10 +15,13 @@ public abstract class AbstractRegexDesensitizationHandler<T extends Annotation> | ||
| 16 | 15 | ||
| 17 | @Override | 16 | @Override |
| 18 | public String desensitize(String origin, T annotation) { | 17 | public String desensitize(String origin, T annotation) { |
| 19 | - Object expressionResult = SpringExpressionUtils.parseExpression(SpringUtil.getApplicationContext(), getCondition(annotation)); | ||
| 20 | - if (expressionResult instanceof Boolean && (Boolean) expressionResult) { | 18 | + // 1. 判断是否禁用脱敏 |
| 19 | + Object disable = SpringExpressionUtils.parseExpression(getDisable(annotation)); | ||
| 20 | + if (Boolean.TRUE.equals(disable)) { | ||
| 21 | return origin; | 21 | return origin; |
| 22 | } | 22 | } |
| 23 | + | ||
| 24 | + // 2. 执行脱敏 | ||
| 23 | String regex = getRegex(annotation); | 25 | String regex = getRegex(annotation); |
| 24 | String replacer = getReplacer(annotation); | 26 | String replacer = getReplacer(annotation); |
| 25 | return origin.replaceAll(regex, replacer); | 27 | return origin.replaceAll(regex, replacer); |
| @@ -41,12 +43,4 @@ public abstract class AbstractRegexDesensitizationHandler<T extends Annotation> | @@ -41,12 +43,4 @@ public abstract class AbstractRegexDesensitizationHandler<T extends Annotation> | ||
| 41 | */ | 43 | */ |
| 42 | abstract String getReplacer(T annotation); | 44 | abstract String getReplacer(T annotation); |
| 43 | 45 | ||
| 44 | - /** | ||
| 45 | - * el 表达式 | ||
| 46 | - * | ||
| 47 | - * @param annotation 注解信息 | ||
| 48 | - * @return el 表达式 | ||
| 49 | - */ | ||
| 50 | - abstract String getCondition(T annotation); | ||
| 51 | - | ||
| 52 | } | 46 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/DefaultRegexDesensitizationHandler.java
| @@ -20,8 +20,8 @@ public class DefaultRegexDesensitizationHandler extends AbstractRegexDesensitiza | @@ -20,8 +20,8 @@ public class DefaultRegexDesensitizationHandler extends AbstractRegexDesensitiza | ||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | @Override | 22 | @Override |
| 23 | - String getCondition(RegexDesensitize annotation) { | ||
| 24 | - return annotation.condition(); | 23 | + public String getDisable(RegexDesensitize annotation) { |
| 24 | + return annotation.disable(); | ||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | } | 27 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/EmailDesensitizationHandler.java
| @@ -19,9 +19,4 @@ public class EmailDesensitizationHandler extends AbstractRegexDesensitizationHan | @@ -19,9 +19,4 @@ public class EmailDesensitizationHandler extends AbstractRegexDesensitizationHan | ||
| 19 | return annotation.replacer(); | 19 | return annotation.replacer(); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | - @Override | ||
| 23 | - String getCondition(EmailDesensitize annotation) { | ||
| 24 | - return annotation.condition(); | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | } | 22 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java
| @@ -38,8 +38,10 @@ public @interface BankCardDesensitize { | @@ -38,8 +38,10 @@ public @interface BankCardDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java
| @@ -38,8 +38,10 @@ public @interface CarLicenseDesensitize { | @@ -38,8 +38,10 @@ public @interface CarLicenseDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/ChineseNameDesensitize.java
| @@ -38,8 +38,10 @@ public @interface ChineseNameDesensitize { | @@ -38,8 +38,10 @@ public @interface ChineseNameDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java
| @@ -38,8 +38,10 @@ public @interface FixedPhoneDesensitize { | @@ -38,8 +38,10 @@ public @interface FixedPhoneDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java
| @@ -38,8 +38,10 @@ public @interface IdCardDesensitize { | @@ -38,8 +38,10 @@ public @interface IdCardDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java
| @@ -38,8 +38,10 @@ public @interface MobileDesensitize { | @@ -38,8 +38,10 @@ public @interface MobileDesensitize { | ||
| 38 | String replacer() default "*"; | 38 | String replacer() default "*"; |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 41 | + * 是否禁用脱敏 |
| 42 | + * | ||
| 43 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 42 | */ | 44 | */ |
| 43 | - String condition() default ""; | 45 | + String disable() default ""; |
| 44 | 46 | ||
| 45 | } | 47 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java
| @@ -40,8 +40,10 @@ public @interface PasswordDesensitize { | @@ -40,8 +40,10 @@ public @interface PasswordDesensitize { | ||
| 40 | String replacer() default "*"; | 40 | String replacer() default "*"; |
| 41 | 41 | ||
| 42 | /** | 42 | /** |
| 43 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 43 | + * 是否禁用脱敏 |
| 44 | + * | ||
| 45 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 44 | */ | 46 | */ |
| 45 | - String condition() default ""; | 47 | + String disable() default ""; |
| 46 | 48 | ||
| 47 | } | 49 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java
| @@ -42,8 +42,10 @@ public @interface SliderDesensitize { | @@ -42,8 +42,10 @@ public @interface SliderDesensitize { | ||
| 42 | int prefixKeep() default 0; | 42 | int prefixKeep() default 0; |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | - * el 表达式,当执行 condition 返回 true 的时候,跳过脱敏 | 45 | + * 是否禁用脱敏 |
| 46 | + * | ||
| 47 | + * 支持 Spring EL 表达式,如果返回 true 则跳过脱敏 | ||
| 46 | */ | 48 | */ |
| 47 | - String condition() default ""; | 49 | + String disable() default ""; |
| 48 | 50 | ||
| 49 | } | 51 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractSliderDesensitizationHandler.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.hutool.extra.spring.SpringUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils; | 3 | import cn.iocoder.yudao.framework.common.util.spring.SpringExpressionUtils; |
| 5 | import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | 4 | import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; |
| 6 | 5 | ||
| @@ -16,10 +15,13 @@ public abstract class AbstractSliderDesensitizationHandler<T extends Annotation> | @@ -16,10 +15,13 @@ public abstract class AbstractSliderDesensitizationHandler<T extends Annotation> | ||
| 16 | 15 | ||
| 17 | @Override | 16 | @Override |
| 18 | public String desensitize(String origin, T annotation) { | 17 | public String desensitize(String origin, T annotation) { |
| 19 | - Object expressionResult = SpringExpressionUtils.parseExpression(SpringUtil.getApplicationContext(), getCondition(annotation)); | ||
| 20 | - if (expressionResult instanceof Boolean && (Boolean) expressionResult) { | 18 | + // 1. 判断是否禁用脱敏 |
| 19 | + Object disable = SpringExpressionUtils.parseExpression(getDisable(annotation)); | ||
| 20 | + if (Boolean.FALSE.equals(disable)) { | ||
| 21 | return origin; | 21 | return origin; |
| 22 | } | 22 | } |
| 23 | + | ||
| 24 | + // 2. 执行脱敏 | ||
| 23 | int prefixKeep = getPrefixKeep(annotation); | 25 | int prefixKeep = getPrefixKeep(annotation); |
| 24 | int suffixKeep = getSuffixKeep(annotation); | 26 | int suffixKeep = getSuffixKeep(annotation); |
| 25 | String replacer = getReplacer(annotation); | 27 | String replacer = getReplacer(annotation); |
| @@ -81,12 +83,4 @@ public abstract class AbstractSliderDesensitizationHandler<T extends Annotation> | @@ -81,12 +83,4 @@ public abstract class AbstractSliderDesensitizationHandler<T extends Annotation> | ||
| 81 | */ | 83 | */ |
| 82 | abstract String getReplacer(T annotation); | 84 | abstract String getReplacer(T annotation); |
| 83 | 85 | ||
| 84 | - /** | ||
| 85 | - * el 表达式 | ||
| 86 | - * | ||
| 87 | - * @param annotation 注解信息 | ||
| 88 | - * @return el 表达式 | ||
| 89 | - */ | ||
| 90 | - abstract String getCondition(T annotation); | ||
| 91 | - | ||
| 92 | } | 86 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java
| @@ -25,8 +25,8 @@ public class BankCardDesensitization extends AbstractSliderDesensitizationHandle | @@ -25,8 +25,8 @@ public class BankCardDesensitization extends AbstractSliderDesensitizationHandle | ||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | - String getCondition(BankCardDesensitize annotation) { | ||
| 29 | - return annotation.condition(); | 28 | + public String getDisable(BankCardDesensitize annotation) { |
| 29 | + return ""; | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | } | 32 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java
| @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseD | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseD | ||
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | public class CarLicenseDesensitization extends AbstractSliderDesensitizationHandler<CarLicenseDesensitize> { | 10 | public class CarLicenseDesensitization extends AbstractSliderDesensitizationHandler<CarLicenseDesensitize> { |
| 11 | + | ||
| 11 | @Override | 12 | @Override |
| 12 | Integer getPrefixKeep(CarLicenseDesensitize annotation) { | 13 | Integer getPrefixKeep(CarLicenseDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| @@ -24,8 +25,8 @@ public class CarLicenseDesensitization extends AbstractSliderDesensitizationHand | @@ -24,8 +25,8 @@ public class CarLicenseDesensitization extends AbstractSliderDesensitizationHand | ||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | @Override | 27 | @Override |
| 27 | - String getCondition(CarLicenseDesensitize annotation) { | ||
| 28 | - return annotation.condition(); | 28 | + public String getDisable(CarLicenseDesensitize annotation) { |
| 29 | + return annotation.disable(); | ||
| 29 | } | 30 | } |
| 30 | 31 | ||
| 31 | } | 32 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java
| @@ -24,9 +24,4 @@ public class ChineseNameDesensitization extends AbstractSliderDesensitizationHan | @@ -24,9 +24,4 @@ public class ChineseNameDesensitization extends AbstractSliderDesensitizationHan | ||
| 24 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | - @Override | ||
| 28 | - String getCondition(ChineseNameDesensitize annotation) { | ||
| 29 | - return annotation.condition(); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | } | 27 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java
| @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesen | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesen | ||
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | public class DefaultDesensitizationHandler extends AbstractSliderDesensitizationHandler<SliderDesensitize> { | 10 | public class DefaultDesensitizationHandler extends AbstractSliderDesensitizationHandler<SliderDesensitize> { |
| 11 | + | ||
| 11 | @Override | 12 | @Override |
| 12 | Integer getPrefixKeep(SliderDesensitize annotation) { | 13 | Integer getPrefixKeep(SliderDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| @@ -23,9 +24,4 @@ public class DefaultDesensitizationHandler extends AbstractSliderDesensitization | @@ -23,9 +24,4 @@ public class DefaultDesensitizationHandler extends AbstractSliderDesensitization | ||
| 23 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | - @Override | ||
| 27 | - String getCondition(SliderDesensitize annotation) { | ||
| 28 | - return annotation.condition(); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | } | 27 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java
| @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneD | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneD | ||
| 8 | * @author gaibu | 8 | * @author gaibu |
| 9 | */ | 9 | */ |
| 10 | public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHandler<FixedPhoneDesensitize> { | 10 | public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHandler<FixedPhoneDesensitize> { |
| 11 | + | ||
| 11 | @Override | 12 | @Override |
| 12 | Integer getPrefixKeep(FixedPhoneDesensitize annotation) { | 13 | Integer getPrefixKeep(FixedPhoneDesensitize annotation) { |
| 13 | return annotation.prefixKeep(); | 14 | return annotation.prefixKeep(); |
| @@ -23,9 +24,4 @@ public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHand | @@ -23,9 +24,4 @@ public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHand | ||
| 23 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | - @Override | ||
| 27 | - String getCondition(FixedPhoneDesensitize annotation) { | ||
| 28 | - return annotation.condition(); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | } | 27 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java
| @@ -23,9 +23,4 @@ public class IdCardDesensitization extends AbstractSliderDesensitizationHandler< | @@ -23,9 +23,4 @@ public class IdCardDesensitization extends AbstractSliderDesensitizationHandler< | ||
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | - @Override | ||
| 27 | - String getCondition(IdCardDesensitize annotation) { | ||
| 28 | - return annotation.condition(); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | } | 26 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java
| @@ -24,9 +24,4 @@ public class MobileDesensitization extends AbstractSliderDesensitizationHandler< | @@ -24,9 +24,4 @@ public class MobileDesensitization extends AbstractSliderDesensitizationHandler< | ||
| 24 | return annotation.replacer(); | 24 | return annotation.replacer(); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | - @Override | ||
| 28 | - String getCondition(MobileDesensitize annotation) { | ||
| 29 | - return annotation.condition(); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | } | 27 | } |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java
| @@ -23,9 +23,4 @@ public class PasswordDesensitization extends AbstractSliderDesensitizationHandle | @@ -23,9 +23,4 @@ public class PasswordDesensitization extends AbstractSliderDesensitizationHandle | ||
| 23 | return annotation.replacer(); | 23 | return annotation.replacer(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | - @Override | ||
| 27 | - String getCondition(PasswordDesensitize annotation) { | ||
| 28 | - return annotation.condition(); | ||
| 29 | - } | ||
| 30 | - | ||
| 31 | } | 26 | } |