fix bug 修改组织机构导入提示语
This commit is contained in:
@@ -66,6 +66,22 @@ public class ValidUtil {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动校验@Vaild并抛出异常信息list
|
||||
*
|
||||
* @param object 待校验对象
|
||||
* @param groups 待校验的组
|
||||
* @return errorList
|
||||
*/
|
||||
public static List<String> validateReturnListWithNum(Object object, int errorRowNum, Class<?>... groups){
|
||||
List<String> list = new ArrayList<>();
|
||||
Set<ConstraintViolation<Object>> set = validator.validate(object, groups);
|
||||
for (ConstraintViolation<Object> constraintViolation : set) {
|
||||
list.add("第" + errorRowNum + "行:"+constraintViolation.getMessage());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description 校验全部数据格式
|
||||
* @Author lqt
|
||||
|
||||
Reference in New Issue
Block a user