@@ -65,6 +65,8 @@ public class LuceneAspectAdvice {
6565 abstractGetTargetIdList .add (new RadioHandler ());
6666 }
6767
68+ private Object proceed ;
69+ private UpuporLucene annotation ;
6870 /**
6971 * 以 controller 包下定义的所有请求为切入点
7072 */
@@ -74,7 +76,8 @@ public void upuporLuceneAspect() {
7476
7577 @ Before ("upuporLuceneAspect() && @annotation(annotation)" )
7678 public void doBefore (JoinPoint joinPoint , UpuporLucene annotation ) {
77- System .out .println ();
79+ this .proceed = null ;
80+ this .annotation = null ;
7881 }
7982
8083 /**
@@ -86,8 +89,13 @@ public void doBefore(JoinPoint joinPoint, UpuporLucene annotation) {
8689 */
8790 @ Around ("upuporLuceneAspect() && @annotation(annotation)" )
8891 public Object doAround (ProceedingJoinPoint proceedingJoinPoint , UpuporLucene annotation ) throws Throwable {
89- Object proceed = proceedingJoinPoint .proceed ();
92+ this .proceed = proceedingJoinPoint .proceed ();
93+ this .annotation = annotation ;
94+ return proceed ;
95+ }
9096
97+ @ After ("upuporLuceneAspect()" )
98+ public void doAfter () {
9199 LuceneEvent luceneEvent = new LuceneEvent ();
92100 luceneEvent .setDataType (annotation .dataType ());
93101 luceneEvent .setOperationType (annotation .operationType ());
@@ -105,13 +113,6 @@ public Object doAround(ProceedingJoinPoint proceedingJoinPoint, UpuporLucene ann
105113 if (StringUtils .isNotEmpty (luceneEvent .getTargetId ())){
106114 publisher .publishEvent (luceneEvent );
107115 }
108-
109- return proceed ;
110- }
111-
112- @ After ("upuporLuceneAspect()" )
113- public void doAfter () {
114-
115116 }
116117
117118}
0 commit comments