You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by xi...@apache.org on 2022/02/08 06:40:41 UTC
[incubator-shenyu] branch master updated: correct param name (#2832)
This is an automated email from the ASF dual-hosted git repository.
xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 1af98f8 correct param name (#2832)
1af98f8 is described below
commit 1af98f851dc1f6026ced4af09dd1d2b90c5a8fdf
Author: dragon-zhang <ha...@webuy.ai>
AuthorDate: Tue Feb 8 14:40:37 2022 +0800
correct param name (#2832)
---
.../springcloud/init/SpringCloudClientBeanPostProcessor.java | 12 ++++++------
.../shenyu/client/tars/TarsServiceBeanPostProcessor.java | 10 +++++-----
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessor.java b/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessor.java
index df7777e..1e709ac 100644
--- a/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessor.java
+++ b/shenyu-client/shenyu-client-http/shenyu-client-springcloud/src/main/java/org/apache/shenyu/client/springcloud/init/SpringCloudClientBeanPostProcessor.java
@@ -136,9 +136,9 @@ public class SpringCloudClientBeanPostProcessor implements BeanPostProcessor {
}
private String buildApiPath(@NonNull final Method method, @NonNull final String superPath) {
- ShenyuSpringCloudClient shenyuSpringMvcClient = AnnotationUtils.findAnnotation(method, ShenyuSpringCloudClient.class);
- if (Objects.nonNull(shenyuSpringMvcClient) && StringUtils.isNotBlank(shenyuSpringMvcClient.path())) {
- return pathJoin(contextPath, superPath, shenyuSpringMvcClient.path());
+ ShenyuSpringCloudClient shenyuSpringCloudClient = AnnotationUtils.findAnnotation(method, ShenyuSpringCloudClient.class);
+ if (Objects.nonNull(shenyuSpringCloudClient) && StringUtils.isNotBlank(shenyuSpringCloudClient.path())) {
+ return pathJoin(contextPath, superPath, shenyuSpringCloudClient.path());
}
final String path = getPathByMethod(method);
if (StringUtils.isNotBlank(path)) {
@@ -175,9 +175,9 @@ public class SpringCloudClientBeanPostProcessor implements BeanPostProcessor {
}
private String buildApiSuperPath(@NonNull final Class<?> method) {
- ShenyuSpringCloudClient shenyuSpringMvcClient = AnnotationUtils.findAnnotation(method, ShenyuSpringCloudClient.class);
- if (Objects.nonNull(shenyuSpringMvcClient) && StringUtils.isNotBlank(shenyuSpringMvcClient.path())) {
- return shenyuSpringMvcClient.path();
+ ShenyuSpringCloudClient shenyuSpringCloudClient = AnnotationUtils.findAnnotation(method, ShenyuSpringCloudClient.class);
+ if (Objects.nonNull(shenyuSpringCloudClient) && StringUtils.isNotBlank(shenyuSpringCloudClient.path())) {
+ return shenyuSpringCloudClient.path();
}
RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
// Only the first path is supported temporarily
diff --git a/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java
index d8f6263..8dc7040 100644
--- a/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java
+++ b/shenyu-client/shenyu-client-tars/src/main/java/org/apache/shenyu/client/tars/TarsServiceBeanPostProcessor.java
@@ -92,9 +92,9 @@ public class TarsServiceBeanPostProcessor implements BeanPostProcessor {
Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
String serviceName = serviceBean.getClass().getAnnotation(ShenyuTarsService.class).serviceName();
for (Method method : methods) {
- ShenyuTarsClient shenyuSofaClient = method.getAnnotation(ShenyuTarsClient.class);
- if (Objects.nonNull(shenyuSofaClient)) {
- publisher.publishEvent(buildMetaDataDTO(serviceName, shenyuSofaClient, method, buildRpcExt(methods)));
+ ShenyuTarsClient shenyuTarsClient = method.getAnnotation(ShenyuTarsClient.class);
+ if (Objects.nonNull(shenyuTarsClient)) {
+ publisher.publishEvent(buildMetaDataDTO(serviceName, shenyuTarsClient, method, buildRpcExt(methods)));
}
}
}
@@ -142,8 +142,8 @@ public class TarsServiceBeanPostProcessor implements BeanPostProcessor {
private String buildRpcExt(final Method[] methods) {
List<TarsRpcExt.RpcExt> list = new ArrayList<>();
for (Method method : methods) {
- ShenyuTarsClient shenyuSofaClient = method.getAnnotation(ShenyuTarsClient.class);
- if (Objects.nonNull(shenyuSofaClient)) {
+ ShenyuTarsClient shenyuTarsClient = method.getAnnotation(ShenyuTarsClient.class);
+ if (Objects.nonNull(shenyuTarsClient)) {
list.add(buildRpcExt(method));
}
}