Class GlobalResponseHandler

java.lang.Object
tech.riemann.etp.web.response.GlobalResponseHandler
All Implemented Interfaces:
org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>

@RestControllerAdvice public class GlobalResponseHandler extends Object implements org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
Author:
Kerbores(kerbores@riemann.tech)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    beforeBodyWrite(Object body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response)
     
    boolean
    supports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GlobalResponseHandler

      public GlobalResponseHandler(List<String> ignorePaths)
      Parameters:
      ignorePaths - 忽略的路径
  • Method Details

    • supports

      public boolean supports(@NonNull org.springframework.core.MethodParameter returnType, @NonNull Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
      Specified by:
      supports in interface org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
    • beforeBodyWrite

      public Object beforeBodyWrite(@Nullable Object body, @NonNull org.springframework.core.MethodParameter returnType, @NonNull org.springframework.http.MediaType selectedContentType, @NonNull Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, @NonNull org.springframework.http.server.ServerHttpRequest request, @NonNull org.springframework.http.server.ServerHttpResponse response)
      Specified by:
      beforeBodyWrite in interface org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>