From ea51622604198a65c6d0001f6bbf7cd0bdd4407e Mon Sep 17 00:00:00 2001 From: wangyu <727842003@qq.com> Date: Wed, 19 Jul 2023 17:19:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=84=9F=E7=9F=A5=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flyfish/rest/registry/proxy/entity/RestMethod.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rest-proxy-core/src/main/java/group/flyfish/rest/registry/proxy/entity/RestMethod.java b/rest-proxy-core/src/main/java/group/flyfish/rest/registry/proxy/entity/RestMethod.java index a0eb409..acb820d 100644 --- a/rest-proxy-core/src/main/java/group/flyfish/rest/registry/proxy/entity/RestMethod.java +++ b/rest-proxy-core/src/main/java/group/flyfish/rest/registry/proxy/entity/RestMethod.java @@ -6,6 +6,8 @@ import group.flyfish.rest.registry.proxy.RestProxyInvoker; import group.flyfish.rest.utils.DataUtils; import lombok.Getter; import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.annotation.MergedAnnotation; +import org.springframework.core.annotation.MergedAnnotations; import java.beans.Transient; import java.lang.reflect.Method; @@ -75,12 +77,13 @@ public class RestMethod { * 初始化方法 */ private void init(Method method, RestProxyInvoker invoker) { - RestApi restApi = AnnotationUtils.findAnnotation(method, RestApi.class); + MergedAnnotation annotation = MergedAnnotations.from(method).get(RestApi.class); // 无视proxy,因为啥也没 - if (null == restApi) { + if (!annotation.isPresent()) { this.invalid = true; return; } + RestApi restApi = annotation.synthesize(); this.url = determineUrl(restApi, invoker); this.method = restApi.method(); this.credentials = restApi.credentials();