Package com.bytedesk.kbase.aop
Class TabooProtobufAspect
java.lang.Object
com.bytedesk.kbase.aop.TabooProtobufAspect
敏感词过滤
注意:不能在类上注解@Async,否则会获取不到 HttpServletRequest,attributes为空。
如果不需要HttpServletRequest,可以添加@Async注解
- Author:
- jackning
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BooleancontainsSensitiveWords(MessageProtobuf messageProtobuf) voiddoAfterReturning(org.aspectj.lang.JoinPoint joinPoint, TabooProtobufFilter tabooProtobufFilter, Object jsonResult) 处理完请求后执行voiddoAfterThrowing(org.aspectj.lang.JoinPoint joinPoint, TabooProtobufFilter tabooProtobufFilter, Exception e) 拦截异常操作voiddoBefore(org.aspectj.lang.JoinPoint joinPoint, TabooProtobufFilter tabooProtobufFilter) 处理请求前执行
-
Field Details
-
tabooRestService
-
-
Constructor Details
-
TabooProtobufAspect
public TabooProtobufAspect()
-
-
Method Details
-
doBefore
处理请求前执行 -
doAfterReturning
public void doAfterReturning(org.aspectj.lang.JoinPoint joinPoint, TabooProtobufFilter tabooProtobufFilter, Object jsonResult) 处理完请求后执行- Parameters:
joinPoint- 切点
-
doAfterThrowing
public void doAfterThrowing(org.aspectj.lang.JoinPoint joinPoint, TabooProtobufFilter tabooProtobufFilter, Exception e) 拦截异常操作- Parameters:
joinPoint- 切点e- 异常
-
containsSensitiveWords
- Parameters:
messageProtobuf- 消息内容- Returns:
- 是否包含敏感词
-