| | |
| | | import org.springframework.cache.annotation.EnableCaching;
|
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.context.annotation.Primary;
|
| | | import org.springframework.data.redis.connection.RedisConnectionFactory;
|
| | | import org.springframework.data.redis.core.RedisTemplate;
|
| | | import org.springframework.data.redis.serializer.StringRedisSerializer;
|
| | |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @SuppressWarnings("deprecation")
|
| | | @Configuration
|
| | | @EnableCaching
|
| | | public class RedisConfig extends CachingConfigurerSupport
|
| | | {
|
| | | @Bean
|
| | | @Bean(name = "ruoyiRedisTemplate")
|
| | | @Primary
|
| | | @SuppressWarnings(value = { "unchecked", "rawtypes" })
|
| | | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
|
| | | public RedisTemplate<Object, Object> ruoyiRedisTemplate(RedisConnectionFactory connectionFactory)
|
| | | {
|
| | | RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
| | | template.setConnectionFactory(connectionFactory);
|