枚举调整

This commit is contained in:
Wang.Huan
2025-03-17 17:02:53 +08:00
parent 8c6be970bb
commit 60bb08925a
13 changed files with 182 additions and 27 deletions

View File

@@ -63,6 +63,18 @@ public class DictAspect {
if (dto == null) {
return;
}
// 检查对象是否是 DTO 类(即是否有 @Dict 注解的字段)
boolean isDto = false;
for (Field field : dto.getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(Dict.class)) {
isDto = true;
break;
}
}
// 如果不是 DTO 类,直接返回
if (!isDto) {
return;
}
// 获取 DTO 类的所有字段
for (Field field : dto.getClass().getDeclaredFields()) {
field.setAccessible(true); // 设置字段可访问