Springboot 自定义注解
数据脱敏注解
创建一个springboot项目
pom 文件
<?xml version="1.0" encoding="UTF-8"?>
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.6.4
com.example
SpringAopText
0.0.1-SNAPSHOT
war
SpringAopText
SpringAopText
<java.version>1.8</java.version>
org.springframework.boot
spring-boot-starter-web
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
&

本文介绍了如何在SpringBoot项目中使用自定义注解进行数据脱敏,包括创建注解、枚举类、脱敏工具类和自定义切面,以实现中文姓名、身份证号、手机号等敏感信息的脱敏处理。提供了测试类和实际运行结果,以及资源下载链接。
最低0.47元/天 解锁文章
20万+

被折叠的 条评论
为什么被折叠?



