Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhpo committed Nov 14, 2023
1 parent 36e0f61 commit 67b78f0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ public class FaceCustomizeSensitiveHandler implements CustomizeSensitiveHandler

### 3.使用`@IgnoreSensitive`注解标注在controller上可忽略脱敏

如果实体类标注了`@Sensitive`脱敏,被多个接口共用的,接口A要脱敏,但是接口B不需要脱敏,就可以使用`@IgnoreSensitive`注解忽略脱敏,同时也支持忽略指定字段脱敏。

#### 1.在Controller类上使用`@IgnoreSensitive`表示此类下所有接口都忽略脱敏

此controller下的所有接口都将忽略脱敏。
Expand Down Expand Up @@ -263,6 +265,22 @@ public class SensitiveController {

sample2将忽略`SampleJavaBean`对象的字段脱敏,sample1不影响。

#### 3.在Controller的类或方法中使用`@IgnoreSensitive`忽略指定字段脱敏

示例:忽略脱敏`SampleJavaBean`中的`name``email`字段的脱敏。
```java
@RestController
@RequestMapping("/")
public class SensitiveController {

@IgnoreSensitive({"name", "email"})
@GetMapping("ignore/sample")
public ResponseEntity<SampleJavaBean> sample() {
return ResponseEntity.ok(SampleJavaBeanMock.sampleJavaBean());
}
}
```

## 注意事项

### 1.有关单独使用`@Builder`/`@SuperBuilder`注解、实体类多层嵌套问题
Expand Down

0 comments on commit 67b78f0

Please sign in to comment.