引入maven包
1 | <dependency> |
注入Validator的bean
1 | package com.qianxunclub.starter.web.autoconfigure; |
添加参数校验的AOP
1 | package com.qianxunclub.starter.web.validator; |
上面@Pointcut("execution(* com.gwghk..*.web.*.*(..))")为Controller
切点位置
BaseResponse为一个统一返回对象,这个可以自定义
使用
使用是需要再Controller入参对象添加校验注解即可:
1 |
|