You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/12 05:51:15 UTC
[GitHub] [incubator-shenyu] gaochuang98 opened a new pull request, #3537: [ISSUE #3484] springmvc client lossless registration
gaochuang98 opened a new pull request, #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537
<!-- Describe your PR here; eg. Fixes #issueNo -->
<!--
Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
-->
Make sure that:
- [ ] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
- [ ] You submit test cases (unit or integration tests) that back your changes.
- [ ] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#discussion_r895115223
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -102,46 +103,42 @@ public SpringMvcClientBeanPostProcessor(final PropertiesConfig clientConfig,
mappingAnnotation.add(RequestMapping.class);
publisher.start(shenyuClientRegisterRepository);
}
-
+
@Override
- public Object postProcessAfterInitialization(@NonNull final Object bean, @NonNull final String beanName) throws BeansException {
- Class<?> clazz = bean.getClass();
- if (AopUtils.isAopProxy(bean)) {
- clazz = AopUtils.getTargetClass(bean);
- }
- // Filter out is not controller out
- if (Boolean.TRUE.equals(isFull) || !hasAnnotation(bean.getClass(), Controller.class)) {
- return bean;
+ public void onApplicationEvent(final ContextRefreshedEvent event) throws BeansException {
+ Map<String, Object> controllerBeans = event.getApplicationContext().getBeansWithAnnotation(Controller.class);
+ for (Map.Entry<String, Object> entry : controllerBeans.entrySet()) {
+ handler(entry.getValue());
}
-
- final ShenyuSpringMvcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuSpringMvcClient.class);
- final String superPath = buildApiSuperPath(clazz);
+ }
+
+ private void handler(@NonNull final Object bean) {
+ final ShenyuSpringMvcClient beanShenyuClient = AnnotationUtils.findAnnotation(bean.getClass(), ShenyuSpringMvcClient.class);
+ final String superPath = buildApiSuperPath(bean.getClass());
// Compatible with previous versions
if (Objects.nonNull(beanShenyuClient) && superPath.contains("*")) {
publisher.publishEvent(buildMetaDataDTO(beanShenyuClient, pathJoin(contextPath, superPath)));
- return bean;
+ return;
}
- final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
+ final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(bean.getClass());
for (Method method : methods) {
final RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);
- ShenyuSpringMvcClient methodShenyuClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuSpringMvcClient.class);
+ ShenyuSpringMvcClient methodShenyuClient = AnnotationUtils.findAnnotation(method, ShenyuSpringMvcClient.class);
methodShenyuClient = Objects.isNull(methodShenyuClient) ? beanShenyuClient : methodShenyuClient;
// the result of ReflectionUtils#getUniqueDeclaredMethods contains method such as hashCode, wait, toSting
// add Objects.nonNull(requestMapping) to make sure not register wrong method
if (Objects.nonNull(methodShenyuClient) && Objects.nonNull(requestMapping)) {
publisher.publishEvent(buildMetaDataDTO(methodShenyuClient, buildApiPath(method, superPath)));
}
}
-
- return bean;
}
-
+
private <A extends Annotation> boolean hasAnnotation(final @NonNull Class<?> clazz, final @NonNull Class<A> annotationType) {
return Objects.nonNull(AnnotationUtils.findAnnotation(clazz, annotationType));
}
-
+
private String buildApiPath(@NonNull final Method method, @NonNull final String superPath) {
- ShenyuSpringMvcClient shenyuSpringMvcClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuSpringMvcClient.class);
+ ShenyuSpringMvcClient shenyuSpringMvcClient = AnnotationUtils.findAnnotation(method, ShenyuSpringMvcClient.class);
Review Comment:
should use `AnnotatedElementUtils#findMergedAnnotation`
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -178,9 +175,9 @@ private String getPathByAnnotation(@Nullable final Annotation annotation, @NonNu
}
return null;
}
-
+
private String buildApiSuperPath(@NonNull final Class<?> method) {
- ShenyuSpringMvcClient shenyuSpringMvcClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuSpringMvcClient.class);
+ ShenyuSpringMvcClient shenyuSpringMvcClient = AnnotationUtils.findAnnotation(method, ShenyuSpringMvcClient.class);
Review Comment:
should use `AnnotatedElementUtils#findMergedAnnotation`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#discussion_r895124240
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -102,24 +104,26 @@ public SpringMvcClientBeanPostProcessor(final PropertiesConfig clientConfig,
mappingAnnotation.add(RequestMapping.class);
publisher.start(shenyuClientRegisterRepository);
}
-
+
@Override
- public Object postProcessAfterInitialization(@NonNull final Object bean, @NonNull final String beanName) throws BeansException {
+ public void onApplicationEvent(final ContextRefreshedEvent event) throws BeansException {
+ Map<String, Object> controllerBeans = event.getApplicationContext().getBeansWithAnnotation(Controller.class);
Review Comment:
lost is full handle
```java
if (Boolean.TRUE.equals(isFull)) {
return bean;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
URL: https://github.com/apache/incubator-shenyu/pull/3537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#discussion_r895115210
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -102,46 +103,42 @@ public SpringMvcClientBeanPostProcessor(final PropertiesConfig clientConfig,
mappingAnnotation.add(RequestMapping.class);
publisher.start(shenyuClientRegisterRepository);
}
-
+
@Override
- public Object postProcessAfterInitialization(@NonNull final Object bean, @NonNull final String beanName) throws BeansException {
- Class<?> clazz = bean.getClass();
- if (AopUtils.isAopProxy(bean)) {
- clazz = AopUtils.getTargetClass(bean);
- }
- // Filter out is not controller out
- if (Boolean.TRUE.equals(isFull) || !hasAnnotation(bean.getClass(), Controller.class)) {
- return bean;
+ public void onApplicationEvent(final ContextRefreshedEvent event) throws BeansException {
+ Map<String, Object> controllerBeans = event.getApplicationContext().getBeansWithAnnotation(Controller.class);
+ for (Map.Entry<String, Object> entry : controllerBeans.entrySet()) {
+ handler(entry.getValue());
}
-
- final ShenyuSpringMvcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuSpringMvcClient.class);
- final String superPath = buildApiSuperPath(clazz);
+ }
+
+ private void handler(@NonNull final Object bean) {
+ final ShenyuSpringMvcClient beanShenyuClient = AnnotationUtils.findAnnotation(bean.getClass(), ShenyuSpringMvcClient.class);
+ final String superPath = buildApiSuperPath(bean.getClass());
// Compatible with previous versions
if (Objects.nonNull(beanShenyuClient) && superPath.contains("*")) {
publisher.publishEvent(buildMetaDataDTO(beanShenyuClient, pathJoin(contextPath, superPath)));
- return bean;
+ return;
}
- final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);
+ final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(bean.getClass());
for (Method method : methods) {
final RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);
- ShenyuSpringMvcClient methodShenyuClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuSpringMvcClient.class);
+ ShenyuSpringMvcClient methodShenyuClient = AnnotationUtils.findAnnotation(method, ShenyuSpringMvcClient.class);
Review Comment:
should use `AnnotatedElementUtils#findMergedAnnotation`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#discussion_r895115141
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -102,46 +103,42 @@ public SpringMvcClientBeanPostProcessor(final PropertiesConfig clientConfig,
mappingAnnotation.add(RequestMapping.class);
publisher.start(shenyuClientRegisterRepository);
}
-
+
@Override
- public Object postProcessAfterInitialization(@NonNull final Object bean, @NonNull final String beanName) throws BeansException {
- Class<?> clazz = bean.getClass();
- if (AopUtils.isAopProxy(bean)) {
- clazz = AopUtils.getTargetClass(bean);
- }
- // Filter out is not controller out
- if (Boolean.TRUE.equals(isFull) || !hasAnnotation(bean.getClass(), Controller.class)) {
- return bean;
+ public void onApplicationEvent(final ContextRefreshedEvent event) throws BeansException {
+ Map<String, Object> controllerBeans = event.getApplicationContext().getBeansWithAnnotation(Controller.class);
+ for (Map.Entry<String, Object> entry : controllerBeans.entrySet()) {
+ handler(entry.getValue());
}
-
- final ShenyuSpringMvcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuSpringMvcClient.class);
- final String superPath = buildApiSuperPath(clazz);
+ }
+
+ private void handler(@NonNull final Object bean) {
+ final ShenyuSpringMvcClient beanShenyuClient = AnnotationUtils.findAnnotation(bean.getClass(), ShenyuSpringMvcClient.class);
Review Comment:
1. lost aop handle
```java
Class<?> clazz = bean.getClass();
if (AopUtils.isAopProxy(bean)) {
clazz = AopUtils.getTargetClass(bean);
}
```
2. should use `AnnotatedElementUtils#findMergedAnnotation`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
URL: https://github.com/apache/incubator-shenyu/pull/3537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
URL: https://github.com/apache/incubator-shenyu/pull/3537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] dragon-zhang merged pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
dragon-zhang merged PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#issuecomment-1153083611
# [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#3537](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1c11434) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/3671086de0da37b302702c88e3917eaee2658155?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3671086) will **decrease** coverage by `0.33%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #3537 +/- ##
============================================
- Coverage 62.83% 62.49% -0.34%
+ Complexity 5571 5536 -35
============================================
Files 842 842
Lines 23351 23343 -8
Branches 2118 2115 -3
============================================
- Hits 14672 14588 -84
- Misses 7331 7403 +72
- Partials 1348 1352 +4
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [.../springmvc/ShenyuSpringMvcClientConfiguration.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXIvc2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXItY2xpZW50L3NoZW55dS1zcHJpbmctYm9vdC1zdGFydGVyLWNsaWVudC1zcHJpbmdtdmMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9zcHJpbmdib290L3N0YXJ0ZXIvY2xpZW50L3NwcmluZ212Yy9TaGVueXVTcHJpbmdNdmNDbGllbnRDb25maWd1cmF0aW9uLmphdmE=) | `100.00% <100.00%> (ø)` | |
| [...plugin/logging/rocketmq/LoggingRocketMQPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvTG9nZ2luZ1JvY2tldE1RUGx1Z2luLmphdmE=) | `22.72% <0.00%> (-72.73%)` | :arrow_down: |
| [...ache/shenyu/plugin/grpc/cache/GrpcClientCache.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9jYWNoZS9HcnBjQ2xpZW50Q2FjaGUuamF2YQ==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [...controller/ShenyuClientHttpRegistryController.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vY29udHJvbGxlci9TaGVueXVDbGllbnRIdHRwUmVnaXN0cnlDb250cm9sbGVyLmphdmE=) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
| [...ogging/rocketmq/body/LoggingServerHttpRequest.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvYm9keS9Mb2dnaW5nU2VydmVySHR0cFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-20.00%)` | :arrow_down: |
| [...ruptor/RegisterClientServerDisruptorPublisher.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vZGlzcnVwdG9yL1JlZ2lzdGVyQ2xpZW50U2VydmVyRGlzcnVwdG9yUHVibGlzaGVyLmphdmE=) | `52.94% <0.00%> (-11.77%)` | :arrow_down: |
| [...a/org/apache/shenyu/common/utils/VersionUtils.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi91dGlscy9WZXJzaW9uVXRpbHMuamF2YQ==) | `67.85% <0.00%> (-10.72%)` | :arrow_down: |
| [.../apache/shenyu/admin/model/dto/BatchCommonDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0JhdGNoQ29tbW9uRFRPLmphdmE=) | `50.00% <0.00%> (-7.15%)` | :arrow_down: |
| [...apache/shenyu/admin/model/dto/AuthPathWarpDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoV2FycERUTy5qYXZh) | `57.14% <0.00%> (-7.15%)` | :arrow_down: |
| [...org/apache/shenyu/admin/model/dto/AuthPathDTO.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vbW9kZWwvZHRvL0F1dGhQYXRoRFRPLmphdmE=) | `58.82% <0.00%> (-5.89%)` | :arrow_down: |
| ... and [38 more](https://codecov.io/gh/apache/incubator-shenyu/pull/3537/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3671086...1c11434](https://codecov.io/gh/apache/incubator-shenyu/pull/3537?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] gaochuang98 commented on a diff in pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
gaochuang98 commented on code in PR #3537:
URL: https://github.com/apache/incubator-shenyu/pull/3537#discussion_r895118952
##########
shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java:
##########
@@ -102,46 +103,42 @@ public SpringMvcClientBeanPostProcessor(final PropertiesConfig clientConfig,
mappingAnnotation.add(RequestMapping.class);
publisher.start(shenyuClientRegisterRepository);
}
-
+
@Override
- public Object postProcessAfterInitialization(@NonNull final Object bean, @NonNull final String beanName) throws BeansException {
- Class<?> clazz = bean.getClass();
- if (AopUtils.isAopProxy(bean)) {
- clazz = AopUtils.getTargetClass(bean);
- }
- // Filter out is not controller out
- if (Boolean.TRUE.equals(isFull) || !hasAnnotation(bean.getClass(), Controller.class)) {
- return bean;
+ public void onApplicationEvent(final ContextRefreshedEvent event) throws BeansException {
+ Map<String, Object> controllerBeans = event.getApplicationContext().getBeansWithAnnotation(Controller.class);
+ for (Map.Entry<String, Object> entry : controllerBeans.entrySet()) {
+ handler(entry.getValue());
}
-
- final ShenyuSpringMvcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuSpringMvcClient.class);
- final String superPath = buildApiSuperPath(clazz);
+ }
+
+ private void handler(@NonNull final Object bean) {
+ final ShenyuSpringMvcClient beanShenyuClient = AnnotationUtils.findAnnotation(bean.getClass(), ShenyuSpringMvcClient.class);
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-shenyu] gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
Posted by GitBox <gi...@apache.org>.
gaochuang98 closed pull request #3537: [ISSUE #3484] springmvc client lossless registration
URL: https://github.com/apache/incubator-shenyu/pull/3537
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org