类 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.HttpInputMessage
    beforeBodyRead(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为空,转为空对象
    boolean
    supports(org.springframework.core.MethodParameter methodParameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
    方法上有DecryptionAnnotation注解的,进入此拦截器 只处理post请求

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • 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 - 消息转换类型
      返回:
      真实的参数