|
|
|
@@ -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<String, PageInfo<WxCouponChannelVo>> getCouponChannelRedisTemplate(RedisConnectionFactory connectionFactory) { |
|
|
|
RedisTemplate<String, PageInfo<WxCouponChannelVo>> template = new RedisTemplate<>(); |
|
|
|
|
|
|
|
Jackson2JsonRedisSerializer<PageInfo> j = new Jackson2JsonRedisSerializer<PageInfo>(PageInfo.class); |
|
|
|
// value值的序列化 |
|
|
|
template.setValueSerializer(j); |
|
|
|
template.setHashKeySerializer(j); |
|
|
|
|
|
|
|
// key的序列化 |
|
|
|
template.setKeySerializer(new StringRedisSerializer()); |
|
|
|
template.setHashKeySerializer(new StringRedisSerializer()); |
|
|
|
|
|
|
|
template.setConnectionFactory(connectionFactory); |
|
|
|
return template; |
|
|
|
} |
|
|
|
} |