docs 补充项目注释

This commit is contained in:
AprilWind
2026-06-01 13:58:13 +08:00
parent 107d3326b4
commit e49f3b2260
94 changed files with 2328 additions and 68 deletions
@@ -18,6 +18,11 @@ import java.lang.annotation.Target;
@Documented
public @interface Sensitive {
/**
* 脱敏策略。
*
* @return 脱敏策略
*/
SensitiveStrategy strategy();
/**
@@ -20,11 +20,25 @@ public class SensitiveJsonFieldProcessor implements JsonFieldProcessor {
@Autowired(required = false)
private SensitiveService sensitiveService;
/**
* 判断字段是否声明了脱敏注解。
*
* @param fieldContext 字段上下文
* @return 是否支持脱敏处理
*/
@Override
public boolean supports(JsonFieldContext fieldContext) {
return fieldContext.getAnnotation(Sensitive.class) != null;
}
/**
* 按字段脱敏策略处理字符串值。
*
* @param fieldContext 字段上下文
* @param value 字段原始值
* @param context JSON 增强上下文
* @return 脱敏后的字段值
*/
@Override
public Object process(JsonFieldContext fieldContext, Object value, JsonEnhancementContext context) {
Sensitive sensitive = fieldContext.getAnnotation(Sensitive.class);