1.参数定义:(注意:@NotEmpty用在集合类上面 ,@NotBlank用在String上面 , @NotNull用在基本类型上)

Springboot 使用BindingResult和自定义注解统一校验参数

2.controller 代码:
Springboot 使用BindingResult和自定义注解统一校验参数

3.自定义注解:
Springboot 使用BindingResult和自定义注解统一校验参数

4.注解AOP:(切面的统一处理逻辑根据各自项目自行实现)
Springboot 使用BindingResult和自定义注解统一校验参数

相关文章: