Merge remote-tracking branch 'origin/feature/REQ-2046'
This commit is contained in:
commit
aab99f85a7
@ -3,6 +3,7 @@ package cn.axzo.pokonyan.config.redis;
|
||||
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
|
||||
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.core.StringRedisTemplate;
|
||||
@ -30,8 +31,9 @@ public class RedisConfiguration {
|
||||
/**
|
||||
* RedisTemplate配置
|
||||
*/
|
||||
@Bean
|
||||
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory factory, RedisSerializer<String> redisKeySerializer, RedisSerializer<Object> redisValueSerializer) {
|
||||
@Primary
|
||||
@Bean(name = "genericRedisTemplate")
|
||||
public StringRedisTemplate genericRedisTemplate(RedisConnectionFactory factory, RedisSerializer<String> redisKeySerializer, RedisSerializer<Object> redisValueSerializer) {
|
||||
StringRedisTemplate redisTemplate = new StringRedisTemplate();
|
||||
redisTemplate.setConnectionFactory(factory);
|
||||
|
||||
@ -48,4 +50,9 @@ public class RedisConfiguration {
|
||||
return redisTemplate;
|
||||
}
|
||||
|
||||
@Bean(name = "stringRedisTemplate")
|
||||
public StringRedisTemplate redisTemplate(RedisConnectionFactory factory) {
|
||||
return new StringRedisTemplate(factory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user