| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -260,40 +263,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -228,47 +231,31 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("stringValueOperations") | |||||
| public ValueOperations<String, String> getStringValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| StringRedisTemplate template = new StringRedisTemplate(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| template.afterPropertiesSet(); | |||||
| return template.opsForValue(); | |||||
| } | } | ||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| return template; | |||||
| } | |||||
| @Bean("stringValueOperations") | |||||
| public ValueOperations<String, String> getStringValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| StringRedisTemplate template = new StringRedisTemplate(); | |||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | template.afterPropertiesSet(); | ||||
| return template.opsForValue(); | |||||
| return template; | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -260,39 +263,23 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -246,41 +249,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -228,40 +231,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -245,40 +248,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -258,40 +261,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,5 +1,8 @@ | |||||
| package com.iformall.config; | package com.iformall.config; | ||||
| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |||||
| import com.fasterxml.jackson.annotation.PropertyAccessor; | |||||
| import com.fasterxml.jackson.databind.ObjectMapper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| @@ -244,40 +247,24 @@ public class RedisConfig extends CachingConfigurerSupport { | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | return template; | ||||
| } | } | ||||
| @Bean("wxAppinfoRedisTemplate") | |||||
| public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); | |||||
| // value值的序列化 | |||||
| template.setValueSerializer(j); | |||||
| template.setHashKeySerializer(j); | |||||
| // key的序列化 | |||||
| template.setKeySerializer(new StringRedisSerializer()); | |||||
| template.setHashKeySerializer(new StringRedisSerializer()); | |||||
| @Bean("objectCommonRedisTemplate") | |||||
| public RedisTemplate<String, Object> getObjectValueOperations(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, Object> template = new RedisTemplate<>(); | |||||
| template.setConnectionFactory(connectionFactory); | template.setConnectionFactory(connectionFactory); | ||||
| return template; | |||||
| } | |||||
| @Bean("wxLevelConfigListRedisTemplate") | |||||
| public RedisTemplate<String, List<WxLevelConfig>> getWxLevelConfigListRedisTemplate(RedisConnectionFactory connectionFactory) { | |||||
| RedisTemplate<String, List<WxLevelConfig>> template = new RedisTemplate<>(); | |||||
| Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer(List.class); | |||||
| Jackson2JsonRedisSerializer<Object> j = new Jackson2JsonRedisSerializer<Object>(Object.class); | |||||
| ObjectMapper om = new ObjectMapper(); | |||||
| om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); | |||||
| j.setObjectMapper(om); | |||||
| // value值的序列化 | // value值的序列化 | ||||
| template.setValueSerializer(j); | template.setValueSerializer(j); | ||||
| template.setHashKeySerializer(j); | |||||
| template.setHashValueSerializer(j); | |||||
| // key的序列化 | // key的序列化 | ||||
| template.setKeySerializer(new StringRedisSerializer()); | template.setKeySerializer(new StringRedisSerializer()); | ||||
| template.setHashKeySerializer(new StringRedisSerializer()); | template.setHashKeySerializer(new StringRedisSerializer()); | ||||
| template.setConnectionFactory(connectionFactory); | |||||
| template.afterPropertiesSet(); | |||||
| return template; | return template; | ||||
| } | } | ||||
| } | } | ||||