From 3b424b233e5da341d965ba58bce34468dc50ee9a Mon Sep 17 00:00:00 2001 From: axzsd Date: Sat, 11 Mar 2023 23:20:30 +0800 Subject: [PATCH] first --- .../desensitize/config/AutoDesensitizeConfiguration.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/applesline/desensitize/config/AutoDesensitizeConfiguration.java b/src/main/java/org/applesline/desensitize/config/AutoDesensitizeConfiguration.java index c266930..eaa61c8 100644 --- a/src/main/java/org/applesline/desensitize/config/AutoDesensitizeConfiguration.java +++ b/src/main/java/org/applesline/desensitize/config/AutoDesensitizeConfiguration.java @@ -4,6 +4,8 @@ import org.applesline.desensitize.aop.DesensitizeAdvice; import org.applesline.desensitize.executor.DesensitizeExecutor; import org.applesline.desensitize.executor.JsonPathDesensitizeExecutor; import org.applesline.desensitize.handle.DesensitizeHandlerSelector; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -15,11 +17,13 @@ import org.springframework.context.annotation.Configuration; public class AutoDesensitizeConfiguration { @Bean + @ConditionalOnMissingBean(DesensitizeHandlerSelector.class) public DesensitizeHandlerSelector maskHandlerSelector() { return new DesensitizeHandlerSelector(); } @Bean + @ConditionalOnMissingBean(DesensitizeExecutor.class) public DesensitizeExecutor maskSensitiveExecutor(DesensitizeHandlerSelector desensitizeHandlerSelector) { return new JsonPathDesensitizeExecutor(desensitizeHandlerSelector); }