Springboot自定义注解

Springboot自定义注解
1.依赖于@Conditional 实现CustomOnPropertyCondition
2.参数 实现HandlerMethodArgumentResolver 只能接受get请求
3.aop
4.拦截器 实现HandlerInterceptorAdapter
主要原理就是拦截所有的请求 然后判断方法上是否有自定的注解 如果有注解 执行注解的操作
需要继承WebMvcConfigurerAdapter的类中,进行注册
5.ConstraintValidator注解实现验证
实现ConstraintValidator

https://blog.csdn.net/qq_20143059/article/details/103243435
posted on 2021-07-17 19:34  弘航  阅读(408)  评论(0)    收藏  举报