From fb9d3f99bebaec8edc4eb1a662608cd028faa461 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 24 Sep 2019 17:28:23 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9][=E5=8D=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8][=E6=B7=BB=E5=8A=A0=E7=BC=93=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/config/RedisConfig.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java b/mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java index 8f732eb31..91be4cbfe 100644 --- a/mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java +++ b/mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java @@ -1,9 +1,11 @@ package com.iformall.config; +import com.github.pagehelper.PageInfo; import com.iformall.domain.po.PushLimit; import com.iformall.domain.po.WxCUser; import com.iformall.domain.po.WxMall; import com.iformall.domain.po.WxScoreRules; +import com.iformall.domain.vo.WxCouponChannelVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cache.CacheManager; @@ -144,4 +146,20 @@ public class RedisConfig extends CachingConfigurerSupport { return template; } + @Bean("couponChannelRedisTemplate") + public RedisTemplate> getCouponChannelRedisTemplate(RedisConnectionFactory connectionFactory) { + RedisTemplate> template = new RedisTemplate<>(); + + Jackson2JsonRedisSerializer j = new Jackson2JsonRedisSerializer(PageInfo.class); + // value值的序列化 + template.setValueSerializer(j); + template.setHashKeySerializer(j); + + // key的序列化 + template.setKeySerializer(new StringRedisSerializer()); + template.setHashKeySerializer(new StringRedisSerializer()); + + template.setConnectionFactory(connectionFactory); + return template; + } }