Преглед изворни кода

[修改][卷列表][添加缓存]

release_toaliyun_real
luozukai пре 6 година
родитељ
комит
53ce50a243
1 измењених фајлова са 19 додато и 0 уклоњено
  1. +19
    -0
      mallinkSysAdmin/src/main/java/com/iformall/config/RedisConfig.java

+ 19
- 0
mallinkSysAdmin/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;
@@ -160,4 +162,21 @@ 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;
}

}

Loading…
Откажи
Сачувај