赞
踩
1、数据脱敏(Data Masking)
又称数据漂白、数据去隐私化或数据变形。
2、指对某些敏感信息通过脱敏规则进行数据的变形,实现敏感隐私数据的可靠保护。
1、导包
<!--数据脱敏的依赖-->
<dependency>
<groupId>io.gitee.chemors</groupId>
<artifactId>secure-ext-spring-boot-starter</artifactId>
<version>1.0.3-RELEASE</version>
</dependency>
2、实体类
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString
public class User {
private Integer Id ;
@DesensitizationProp(SensitiveTypeEnum.CHINESE_NAME)
private String name;
@DesensitizationProp(SensitiveTypeEnum.EMAIL)
private String email;
@DesensitizationProp(SensitiveTypeEnum.MOBILE_PHONE)
private String phoneNum;
@DesensitizationProp(SensitiveTypeEnum.BANK_CARD)
private String bankUnm;
}
控制器
@RestController
public class UserController {
@Desensitization
@RequestMapping(value = "/tuomin")
public User test (){
return new User(1,"不是山谷","txx.l@aliyun.com","13322223369","61616116161616154");
}
}
{
"name": "不***",
"email": "t****@aliyun.com",
"phoneNum": "133****3369",
"bankUnm": "6161 **** **** * 6154",
"id": 1
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。