|
|
|
@@ -2,11 +2,14 @@ package com.iformall.service.util; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.vo.WxMerchantVo; |
|
|
|
import com.iformall.enums.EnumCacheKey; |
|
|
|
import com.iformall.utils.RedisCacheUtils; |
|
|
|
|
|
|
|
public class CouponCacheUtils { |
|
|
|
@@ -57,19 +60,25 @@ public class CouponCacheUtils { |
|
|
|
return RedisCacheUtils.getCacheListObject(template, key,WxMerchantVo.class); |
|
|
|
} |
|
|
|
|
|
|
|
// public static void removeDouyinLivePageCache(RedisTemplate<String, Object> template,String tenantId,Integer targetAd,Integer bussiness) { |
|
|
|
// String key = "couponMerchant:"+couponId; |
|
|
|
// RedisCacheUtils.removeCache(template, key); |
|
|
|
// } |
|
|
|
// |
|
|
|
// public static void setDouyinLivePageCache(RedisTemplate<String, Object> template,Long couponId,List<WxMerchantVo> merchantList) { |
|
|
|
// String key = "couponMerchant:"+couponId; |
|
|
|
// RedisCacheUtils.cache(template, key, merchantList, 24*3600); |
|
|
|
// } |
|
|
|
// |
|
|
|
// public static List<WxMerchantVo> getDouyinLivePageCache(RedisTemplate<String, Object> template,Long couponId) { |
|
|
|
// String key = "couponMerchant:"+couponId; |
|
|
|
// return RedisCacheUtils.getCacheListObject(template, key,WxMerchantVo.class); |
|
|
|
// } |
|
|
|
public static void removeDouyinLivePageCache(RedisTemplate<String, Object> template,String tenantId,Integer targetAd,Integer bussiness) { |
|
|
|
String key = EnumCacheKey.DOUYIN_LIVE_PAGE_LIST.getMessage()+ tenantId+"_"; |
|
|
|
if (null != targetAd) { |
|
|
|
key = key + targetAd; |
|
|
|
if ( null != bussiness) { |
|
|
|
key = key + "_"+ bussiness; |
|
|
|
} |
|
|
|
} |
|
|
|
RedisCacheUtils.removeCachePrefix(template, key); |
|
|
|
} |
|
|
|
|
|
|
|
public static void setDouyinLivePageCache(RedisTemplate<String, Object> template,PageInfo<WxCoupon> pageList,String tenantId,Integer targetAd,Integer bussiness,Integer pageNum) { |
|
|
|
String key = EnumCacheKey.DOUYIN_LIVE_PAGE_LIST.getMessage()+ tenantId + "_"+ targetAd + "_"+ bussiness+"_"+pageNum; |
|
|
|
RedisCacheUtils.cache(template, key, pageList, 3*3600); |
|
|
|
} |
|
|
|
|
|
|
|
public static PageInfo getDouyinLivePageCache(RedisTemplate<String, Object> template,String tenantId,Integer targetAd,Integer bussiness,Integer pageNum) { |
|
|
|
String key = EnumCacheKey.DOUYIN_LIVE_PAGE_LIST.getMessage()+ tenantId + "_"+ targetAd + "_"+ bussiness+"_"+pageNum; |
|
|
|
return RedisCacheUtils.getCacheObject(template, key,PageInfo.class); |
|
|
|
} |
|
|
|
|
|
|
|
} |