@Order(value=1) @ControllerAdvice public class DecryptRequestBodyAdvice extends Object implements org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
RequestBody
以及package为
com.sinosoftgz.starter.encrypt.annotation.decrypt
下的注解有效
Created by Roney on 2020/12/25
RequestBodyAdvice| 构造器和说明 |
|---|
DecryptRequestBodyAdvice() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
afterBodyRead(Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
读取参数后执行
|
org.springframework.http.HttpInputMessage |
beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
读取参数前执行
在此做些编码 / 解密 / 封装参数为对象的操作
|
Object |
handleEmptyBody(Object body,
org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
无请求时的处理
|
boolean |
supports(org.springframework.core.MethodParameter methodParameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
此处如果返回false , 则不执行当前Advice的业务
|
public boolean supports(org.springframework.core.MethodParameter methodParameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
supports 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicemethodParameter - 用来获取注解targetType - 省略converterType - 省略public Object handleEmptyBody(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
handleEmptyBody 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicebody - bodyinputMessage - messageparameter - parametertargetType - targetTypeconverterType - converterTypepublic org.springframework.http.HttpInputMessage beforeBodyRead(org.springframework.http.HttpInputMessage inputMessage,
org.springframework.core.MethodParameter parameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
beforeBodyRead 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceinputMessage - inputMessageparameter - parametertargetType - targetTypeconverterType - converterTypepublic Object afterBodyRead(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
afterBodyRead 在接口中 org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvicebody - bodyinputMessage - inputMessageparameter - parametertargetType - targetTypeconverterType - converterTypeCopyright © 2024. All rights reserved.