后端校验

后端校验方式可参考以下方法: 
1.实体类中添加校验注解,参考:ChecktemplateSupport
2.接口方法参数前添加注解@Validated,参数后添加BindingResult bindingResult接收错误

3.ValidateExceptionUtil.handleBindException(bindingResult).getStatus()判断校验是否通过  参考CheckTemplateController  addCheckTemplate方法 



猜你喜欢

转载自blog.csdn.net/m0_38053538/article/details/80693753
今日推荐