From 377ce540f1f322a9f72fecbc3e2ee6d8bf32cb07 Mon Sep 17 00:00:00 2001 From: aoshiguchen <1052045476@qq.com> Date: Fri, 1 Jul 2022 11:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8B=A6=E6=88=AA=E5=99=A8?= =?UTF-8?q?=E7=9A=84=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aop/interceptor/InterceptorFactory.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/interceptor/InterceptorFactory.java b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/interceptor/InterceptorFactory.java index 39165d8f..7c1b3caa 100644 --- a/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/interceptor/InterceptorFactory.java +++ b/neutrino-core/src/main/java/fun/asgc/neutrino/core/aop/interceptor/InterceptorFactory.java @@ -190,22 +190,6 @@ public class InterceptorFactory { if (null == interceptors || null == intercept) { return; } - if (ArrayUtil.notEmpty(intercept.value())) { - for (Class clazz : intercept.value()) { - Interceptor interceptor = get(clazz); - if (null != interceptor && !interceptors.contains(interceptor)) { - interceptors.add(interceptor); - } - } - } - if (ArrayUtil.notEmpty(intercept.exclude())) { - for (Class clazz : intercept.exclude()) { - Interceptor interceptor = get(clazz); - if (null != interceptor && interceptors.contains(interceptor)) { - interceptors.remove(interceptor); - } - } - } if (ArrayUtil.notEmpty(intercept.filter()) || ArrayUtil.notEmpty(intercept.resultAdvice()) || ArrayUtil.notEmpty(intercept.exceptionHandler())) { InterceptorWrapper wrapper = new InterceptorWrapper(); List filterList = getFilterList(intercept.filter()); @@ -222,6 +206,22 @@ public class InterceptorFactory { } interceptors.add(wrapper); } + if (ArrayUtil.notEmpty(intercept.value())) { + for (Class clazz : intercept.value()) { + Interceptor interceptor = get(clazz); + if (null != interceptor && !interceptors.contains(interceptor)) { + interceptors.add(interceptor); + } + } + } + if (ArrayUtil.notEmpty(intercept.exclude())) { + for (Class clazz : intercept.exclude()) { + Interceptor interceptor = get(clazz); + if (null != interceptor && interceptors.contains(interceptor)) { + interceptors.remove(interceptor); + } + } + } if (intercept.ignoreGlobal()) { interceptors.removeAll(globalInterceptorList); }