5de5e259 by chentao

no message

1 parent 66476346
...@@ -30,6 +30,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn ...@@ -30,6 +30,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn
30 try { 30 try {
31 Field field = object.getClass().getDeclaredField(fieldName); 31 Field field = object.getClass().getDeclaredField(fieldName);
32 field.setAccessible(true); // 设置私有字段可访问,以便读取值 32 field.setAccessible(true); // 设置私有字段可访问,以便读取值
33 System.out.println(field.getName()+"============"+field.get(object));
33 if (Objects.nonNull(field.get(object))) { // 检查字段是否非空 34 if (Objects.nonNull(field.get(object))) { // 检查字段是否非空
34 return true; // 如果至少一个字段非空,返回true 35 return true; // 如果至少一个字段非空,返回true
35 } 36 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!