后端校验方式可参考以下方法:
1.实体类中添加校验注解,参考:ChecktemplateSupport
2.接口方法参数前添加注解@Validated,参数后添加BindingResult bindingResult接收错误
1.实体类中添加校验注解,参考:ChecktemplateSupport
2.接口方法参数前添加注解@Validated,参数后添加BindingResult bindingResult接收错误
3.ValidateExceptionUtil.handleBindException(bindingResult).getStatus()判断校验是否通过 参考CheckTemplateController addCheckTemplate方法