类 DecryptRequestBodyAdvice
java.lang.Object
com.sh.spring.encrypt.DecryptRequestBodyAdvice
- 所有已实现的接口:
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
@ControllerAdvice
public class DecryptRequestBodyAdvice
extends Object
implements org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
Description: 请求参数解密,针对post请求
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明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.HttpInputMessagebeforeBodyRead(org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) handleEmptyBody(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) 如果body为空,转为空对象booleansupports(org.springframework.core.MethodParameter methodParameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) 方法上有DecryptionAnnotation注解的,进入此拦截器 只处理post请求
-
构造器详细资料
-
DecryptRequestBodyAdvice
public DecryptRequestBodyAdvice()
-
-
方法详细资料
-
supports
public boolean supports(org.springframework.core.MethodParameter methodParameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) 方法上有DecryptionAnnotation注解的,进入此拦截器 只处理post请求- 指定者:
supports在接口中org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice- 参数:
methodParameter- 方法参数对象targetType- 参数的类型converterType- 消息转换器- 返回:
- true,进入,false,跳过
-
beforeBodyRead
public 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) throws IOException - 指定者:
beforeBodyRead在接口中org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice- 抛出:
IOException
-
afterBodyRead
public 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.RequestBodyAdvice- 参数:
body- spring解析完的参数inputMessage- 输入参数parameter- 参数对象targetType- 参数类型converterType- 消息转换类型- 返回:
- 真实的参数
-
handleEmptyBody
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) 如果body为空,转为空对象- 指定者:
handleEmptyBody在接口中org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice- 参数:
body- spring解析完的参数inputMessage- 输入参数parameter- 参数对象targetType- 参数类型converterType- 消息转换类型- 返回:
- 真实的参数
-