@ControllerAdvice
public class XforceRequestBodyAdviceAdapter
extends org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
这个advice仅支持参数为@RequestBody的接口日志,一般为POST、PUT、PATCH等类型的请求 对于Get请求及文件上传,不会走到这个逻辑,通过tenant-security提供的interceptor进行拦截记录简单日志
| 构造器和说明 |
|---|
XforceRequestBodyAdviceAdapter() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Object |
afterBodyRead(java.lang.Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
The default implementation returns the body that was passed in.
|
org.springframework.http.HttpInputMessage |
beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
The default implementation returns the InputMessage that was passed in.
|
java.lang.Object |
handleEmptyBody(java.lang.Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
The default implementation returns the body that was passed in.
|
boolean |
supports(org.springframework.core.MethodParameter methodParameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
Invoked first to determine if this interceptor applies.
|
public boolean supports(org.springframework.core.MethodParameter methodParameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
methodParameter - the method parametertargetType - the target type, not necessarily the same as the method
parameter type, e.g. for HttpEntity<String>.converterType - the selected converter typepublic org.springframework.http.HttpInputMessage beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
throws java.io.IOException
beforeBodyRead 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicebeforeBodyRead 在类中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapterinputMessage - parameter - targetType - converterType - java.io.IOExceptionpublic java.lang.Object afterBodyRead(java.lang.Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
afterBodyRead 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceafterBodyRead 在类中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapterbody - inputMessage - parameter - targetType - converterType - public java.lang.Object handleEmptyBody(java.lang.Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
java.lang.reflect.Type targetType,
java.lang.Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
handleEmptyBody 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicehandleEmptyBody 在类中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapterbody - inputMessage - parameter - targetType - converterType -