|
|
@@ -65,47 +65,47 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
@Bean("pushLimitRedisTemplate") |
|
|
@Bean("pushLimitRedisTemplate") |
|
|
public RedisTemplate<String, PushLimit> getPushLimitRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, PushLimit> getPushLimitRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, PushLimit> template = new RedisTemplate<String, PushLimit>(); |
|
|
RedisTemplate<String, PushLimit> template = new RedisTemplate<String, PushLimit>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<PushLimit> j = new Jackson2JsonRedisSerializer<PushLimit>(PushLimit.class); |
|
|
Jackson2JsonRedisSerializer<PushLimit> j = new Jackson2JsonRedisSerializer<PushLimit>(PushLimit.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("scoreRuleRedisTemplate") |
|
|
@Bean("scoreRuleRedisTemplate") |
|
|
public RedisTemplate<String, WxScoreRules> getScoreRuleRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxScoreRules> getScoreRuleRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxScoreRules> template = new RedisTemplate<String, WxScoreRules>(); |
|
|
RedisTemplate<String, WxScoreRules> template = new RedisTemplate<String, WxScoreRules>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class); |
|
|
Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("cuserTokenRedisTemplate") |
|
|
@Bean("cuserTokenRedisTemplate") |
|
|
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>(); |
|
|
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxCUser> j = new Jackson2JsonRedisSerializer<WxCUser>(WxCUser.class); |
|
|
Jackson2JsonRedisSerializer<WxCUser> j = new Jackson2JsonRedisSerializer<WxCUser>(WxCUser.class); |
|
|
|
|
|
|
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
@@ -114,13 +114,13 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
|
|
|
|
|
|
// 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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -128,6 +128,7 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, BaseCUserEntity> getBaseCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); |
|
|
RedisTemplate<String, BaseCUserEntity> template = new RedisTemplate<String, BaseCUserEntity>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); |
|
|
Jackson2JsonRedisSerializer<BaseCUserEntity> j = new Jackson2JsonRedisSerializer<BaseCUserEntity>(BaseCUserEntity.class); |
|
|
|
|
|
|
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
@@ -136,20 +137,20 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
|
|
|
|
|
|
// 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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("cUserBasicInfoRedisTemplate") |
|
|
@Bean("cUserBasicInfoRedisTemplate") |
|
|
public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxCUserBasicInfo> getCUserBasicInfoRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); |
|
|
RedisTemplate<String, WxCUserBasicInfo> template = new RedisTemplate<String, WxCUserBasicInfo>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); |
|
|
Jackson2JsonRedisSerializer<WxCUserBasicInfo> j = new Jackson2JsonRedisSerializer<WxCUserBasicInfo>(WxCUserBasicInfo.class); |
|
|
|
|
|
|
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
@@ -157,20 +158,20 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("mallRedisTemplate") |
|
|
@Bean("mallRedisTemplate") |
|
|
public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxMall> getMallRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); |
|
|
RedisTemplate<String, WxMall> template = new RedisTemplate<String, WxMall>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxMall> j = new Jackson2JsonRedisSerializer<WxMall>(WxMall.class); |
|
|
Jackson2JsonRedisSerializer<WxMall> j = new Jackson2JsonRedisSerializer<WxMall>(WxMall.class); |
|
|
|
|
|
|
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
@@ -178,60 +179,60 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("subMallListRedisTemplate") |
|
|
@Bean("subMallListRedisTemplate") |
|
|
public RedisTemplate<String, List<WxMall>> getSubMallListRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, List<WxMall>> getSubMallListRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, List<WxMall>> template = new RedisTemplate<String, List<WxMall>>(); |
|
|
RedisTemplate<String, List<WxMall>> template = new RedisTemplate<String, List<WxMall>>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer<List>(List.class); |
|
|
Jackson2JsonRedisSerializer<List> j = new Jackson2JsonRedisSerializer<List>(List.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("couponDetailRedisTemplate") |
|
|
@Bean("couponDetailRedisTemplate") |
|
|
public RedisTemplate<String, WxCouponCVo> getCouponDetailRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxCouponCVo> getCouponDetailRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxCouponCVo> template = new RedisTemplate<String, WxCouponCVo>(); |
|
|
RedisTemplate<String, WxCouponCVo> template = new RedisTemplate<String, WxCouponCVo>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxCouponCVo> j = new Jackson2JsonRedisSerializer<WxCouponCVo>(WxCouponCVo.class); |
|
|
Jackson2JsonRedisSerializer<WxCouponCVo> j = new Jackson2JsonRedisSerializer<WxCouponCVo>(WxCouponCVo.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("couponChannelRedisTemplate") |
|
|
@Bean("couponChannelRedisTemplate") |
|
|
public RedisTemplate<String, PageInfo<WxCouponChannelVo>> getCouponChannelRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, PageInfo<WxCouponChannelVo>> getCouponChannelRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, PageInfo<WxCouponChannelVo>> template = new RedisTemplate<>(); |
|
|
RedisTemplate<String, PageInfo<WxCouponChannelVo>> template = new RedisTemplate<>(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<PageInfo> j = new Jackson2JsonRedisSerializer<PageInfo>(PageInfo.class); |
|
|
Jackson2JsonRedisSerializer<PageInfo> j = new Jackson2JsonRedisSerializer<PageInfo>(PageInfo.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
@@ -239,20 +240,20 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
|
|
|
|
|
|
// 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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("buserTokenRedisTemplate") |
|
|
@Bean("buserTokenRedisTemplate") |
|
|
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxBuser> template = new RedisTemplate(); |
|
|
RedisTemplate<String, WxBuser> template = new RedisTemplate(); |
|
|
|
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
Jackson2JsonRedisSerializer<WxBuser> j = new Jackson2JsonRedisSerializer(WxBuser.class); |
|
|
Jackson2JsonRedisSerializer<WxBuser> j = new Jackson2JsonRedisSerializer(WxBuser.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
@@ -260,84 +261,62 @@ public class RedisConfig extends CachingConfigurerSupport { |
|
|
|
|
|
|
|
|
// 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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("pressOrderRedisTemplate") |
|
|
@Bean("pressOrderRedisTemplate") |
|
|
public RedisTemplate<String, WxOrder> getPressOrderRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
public RedisTemplate<String, WxOrder> getPressOrderRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
RedisTemplate<String, WxOrder> template = new RedisTemplate<>(); |
|
|
RedisTemplate<String, WxOrder> template = new RedisTemplate<>(); |
|
|
|
|
|
|
|
|
Jackson2JsonRedisSerializer<WxOrder> j = new Jackson2JsonRedisSerializer(WxOrder.class); |
|
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
|
|
|
Jackson2JsonRedisSerializer<WxOrder> j = new Jackson2JsonRedisSerializer<WxOrder>(WxOrder.class); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Bean("wxAppinfoRedisTemplate") |
|
|
|
|
|
public RedisTemplate<String, WxAppinfo> getWxAppinfoRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
|
|
|
RedisTemplate<String, WxAppinfo> template = new RedisTemplate<>(); |
|
|
|
|
|
|
|
|
|
|
|
Jackson2JsonRedisSerializer<WxAppinfo> j = new Jackson2JsonRedisSerializer(WxAppinfo.class); |
|
|
|
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
|
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
|
|
|
j.setObjectMapper(om); |
|
|
|
|
|
|
|
|
|
|
|
// 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(); |
|
|
ObjectMapper om = new ObjectMapper(); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|
|
j.setObjectMapper(om); |
|
|
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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |