master
axzsd 2023-03-11 23:20:30 +08:00
parent 730e75d920
commit 3b424b233e
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}