com.qingzhuge.framework.cache.autoconfigure.J2CacheRedisAutoConfiguration Maven / Gradle / Ivy
package com.qingzhuge.framework.cache.autoconfigure;
import com.qingzhuge.framework.cache.support.CacheSerializer;
import com.qingzhuge.framework.cache.support.LongRedisSerializer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.io.Serializable;
/**
* @author :zero.xiao
* datetime :2018/1/14 16:46
**/
@Slf4j
@Configuration
@ConditionalOnProperty(prefix= J2CacheProperties.CACHE_PREFIX,name = "open",havingValue = "true",matchIfMissing = true)
@Import(RedisAutoConfiguration.class)
public class J2CacheRedisAutoConfiguration {
@Bean
public RedisSerializer