Package com.bytedesk.core.aop
Class BlackUserAspect
java.lang.Object
com.bytedesk.core.aop.BlackUserAspect
黑名单用户拦截器
注意:不能在类上注解@Async,否则会获取不到 HttpServletRequest,attributes为空。
如果不需要HttpServletRequest,可以添加@Async注解
- Author:
- jackning
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
containsBlackUser
(String messageJson) void
doAfterReturning
(org.aspectj.lang.JoinPoint joinPoint, BlackUserFilter blackUserFilter, Object jsonResult) 处理完请求后执行void
doAfterThrowing
(org.aspectj.lang.JoinPoint joinPoint, BlackUserFilter blackUserFilter, Exception e) 拦截异常操作void
doBefore
(org.aspectj.lang.JoinPoint joinPoint, BlackUserFilter blackUserFilter) 处理请求前执行
-
Field Details
-
blackRestService
-
-
Constructor Details
-
BlackUserAspect
public BlackUserAspect()
-
-
Method Details
-
doBefore
处理请求前执行 -
doAfterReturning
public void doAfterReturning(org.aspectj.lang.JoinPoint joinPoint, BlackUserFilter blackUserFilter, Object jsonResult) 处理完请求后执行- Parameters:
joinPoint
- 切点
-
doAfterThrowing
public void doAfterThrowing(org.aspectj.lang.JoinPoint joinPoint, BlackUserFilter blackUserFilter, Exception e) 拦截异常操作- Parameters:
joinPoint
- 切点e
- 异常
-
containsBlackUser
- Parameters:
message
- 消息内容- Returns:
- 是否包含黑名单用户
-