You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/08/11 16:04:17 UTC

[GitHub] [skywalking] whfjam removed a comment on issue #5291: since the issue #4907 i think the class RestMappingMethodInterceptor should implements the method “getAcceptedMethodTypes”

whfjam removed a comment on issue #5291:
URL: https://github.com/apache/skywalking/issues/5291#issuecomment-672051413


   > 
   > 
   > #5085 is my attempt at fixing this. The only thing not working is the e2e tests.
   
   here is my code if any helps to you
   
   
   
   @Override
       public String getAcceptedMethodTypes(Method method) {
           return ParsePathUtil.recursiveParseMethodAnnotaion(method, m -> {
               GetMapping getMapping = AnnotationUtils.getAnnotation(m, GetMapping.class);
               if (getMapping != null) {
                   return RequestMethod.GET.toString();
               }
               PostMapping postMapping = AnnotationUtils.getAnnotation(m, PostMapping.class);
               if (postMapping != null) {
                   return RequestMethod.POST.toString();
               }
               PutMapping putMapping = AnnotationUtils.getAnnotation(m, PutMapping.class);
               if (putMapping != null) {
                   return RequestMethod.PUT.toString();
               }
               DeleteMapping deleteMapping = AnnotationUtils.getAnnotation(m, DeleteMapping.class);
               if (deleteMapping != null) {
                   return RequestMethod.DELETE.toString();
               }
               PatchMapping patchMapping = AnnotationUtils.getAnnotation(m, PatchMapping.class);
               if (patchMapping != null) {
                   return RequestMethod.PATCH.toString();
               }
               return null;
           });
       }


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org