type
status
date
slug
summary
tags
category
icon
😀
通过对接口切点与注解的扫描,完成对接口的aop监控
 

📝 注意事项

1,启动类注解是否有(防止aop所在扫描不到)

测试方法,aop中写构造方法,查询是否扫描到:

2,切点注解写正确

其中最后一个必须要有,否则切点设置失败,aop无法成功进行,最后一个是实现aop注解监控的位置

整个aop代码

其中MethodSignature signature = (MethodSignature) joinPoint.getSignature和ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); HttpServletRequest request = attributes.getRequest();是获取请求信息的重点方法
 
💡
有关Notion安装或者使用上的问题,欢迎您在底部评论区留言,一起交流~
redis安装配置以及使用判空处理