Package club.zhcs.lina.web.response
Class GlobalResponseHandler
java.lang.Object
club.zhcs.lina.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 -
Method Summary
Modifier and TypeMethodDescriptionbeforeBodyWrite(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) booleansupports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
-
Constructor Details
-
GlobalResponseHandler
- 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:
supportsin interfaceorg.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:
beforeBodyWritein interfaceorg.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<Object>
-