com.avocado.boot.starter.redis.config.RedisConfiguration Maven / Gradle / Ivy
package com.avocado.boot.starter.redis.config;
import com.avocado.boot.starter.redis.utils.RedisUtil;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cache.Cache;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @author :qiaoliang
* @date :2020-07-16
*/
@Configuration
@EnableCaching
public class RedisConfiguration extends CachingConfigurerSupport {
private static final Logger log = LoggerFactory.getLogger(RedisConfiguration.class);
/**
* 实例化 RedisTemplate 对象
*
* @author :qiaoliang
* @param connectionFactory : connectionFactory
* @return org.springframework.data.redis.core.RedisTemplate
*/
@Bean
public RedisTemplate
© 2015 - 2024 Weber Informatics LLC | Privacy Policy