类 CoreConfig

  • 所有已实现的接口:
    org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    @Configuration
    public class CoreConfig
    extends java.lang.Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    核心配置
    作者:
    youta
    • 构造器概要

      构造器 
      构造器 说明
      CoreConfig()  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
      Interceptor 注册
      org.springframework.web.filter.CorsFilter corsFilter()
      跨域配置
      com.fasterxml.jackson.databind.ObjectMapper objectMapper()
      日期序列化
      org.springframework.data.redis.core.RedisTemplate<java.lang.String,​java.io.Serializable> redisTemplate​(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory connectionFactory)
      Redis 操作工具
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 从接口继承的方法 org.springframework.web.servlet.config.annotation.WebMvcConfigurer

        addArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
    • 构造器详细资料

      • CoreConfig

        public CoreConfig()
    • 方法详细资料

      • corsFilter

        @Bean
        public org.springframework.web.filter.CorsFilter corsFilter()
        跨域配置
        返回:
        CorsFilter
      • objectMapper

        @Bean
        @Primary
        public com.fasterxml.jackson.databind.ObjectMapper objectMapper()
        日期序列化
        返回:
        ObjectMapper
      • redisTemplate

        @Bean
        public org.springframework.data.redis.core.RedisTemplate<java.lang.String,​java.io.Serializable> redisTemplate​(org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory connectionFactory)
        Redis 操作工具
        参数:
        connectionFactory - connection
        返回:
        RedisTemplate
      • addInterceptors

        public void addInterceptors​(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
        Interceptor 注册

        手 动 注 册

        指定者:
        addInterceptors 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer
        参数:
        registry - registry