提交 853d6d77 编写于 作者: 街头小贩's avatar 街头小贩

不再依赖spring-jcl

上级 7f9c46a0
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
<version>${spring-framework.version}</version> <version>${spring-framework.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>commons-logging</groupId> <groupId>org.springframework</groupId>
<artifactId>commons-logging</artifactId> <artifactId>spring-jcl</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
......
...@@ -25,6 +25,8 @@ import org.springframework.data.redis.connection.RedisStandaloneConfiguration; ...@@ -25,6 +25,8 @@ import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.jedis.JedisClientConfiguration; import org.springframework.data.redis.connection.jedis.JedisClientConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
...@@ -156,6 +158,10 @@ public class ThronesAdminAppConfig { ...@@ -156,6 +158,10 @@ public class ThronesAdminAppConfig {
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory cf) { public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory cf) {
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(cf); redisTemplate.setConnectionFactory(cf);
redisTemplate.setKeySerializer(new StringRedisSerializer());
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
return redisTemplate; return redisTemplate;
} }
@Bean @Bean
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册