private String checkDTO(Object object){
if (null == object) {
return "必填字段不能为空";
}
try {
//循环遍历对象属性
for(Field f : object.getClass().getDeclaredFields()){
f.setAccessible(true);
//判断对象属性是否为空
if(f.get(object) == null || f.get(object).equals("")){
return "必填字段不能为空";
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}