|
|
|
@@ -3,6 +3,7 @@ package com.iformall.service.util; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.domain.po.WxCoupon; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.vo.WxCouponCVo; |
|
|
|
import com.iformall.domain.vo.WxMerchantVo; |
|
|
|
import com.iformall.enums.EnumCacheKey; |
|
|
|
import com.iformall.utils.RedisCacheUtils; |
|
|
|
@@ -131,4 +132,29 @@ public class CouponCacheUtils { |
|
|
|
return RedisCacheUtils.getCacheObject(template, key,PageInfo.class); |
|
|
|
} |
|
|
|
|
|
|
|
public static void removeOldDetailCache(RedisTemplate<String, Object> template) { |
|
|
|
String key = EnumCacheKey.OLD_DETAIL.getMessage(); |
|
|
|
RedisCacheUtils.removeCachePrefix(template, key); |
|
|
|
} |
|
|
|
|
|
|
|
public static void setOldDetaileCache(RedisTemplate<String, Object> template,WxCouponCVo coupon,Long couponChannelIdL,Long couponIdL) { |
|
|
|
String key = EnumCacheKey.OLD_DETAIL.getMessage(); |
|
|
|
if(couponChannelIdL > 0){ |
|
|
|
key = key + couponChannelIdL; |
|
|
|
}else if(couponIdL > 0){ |
|
|
|
key = key + couponIdL; |
|
|
|
} |
|
|
|
RedisCacheUtils.cache(template, key, coupon, 3600); |
|
|
|
} |
|
|
|
|
|
|
|
public static WxCouponCVo getOldDetailCache(RedisTemplate<String, Object> template,Long couponChannelIdL,Long couponIdL) { |
|
|
|
String key = EnumCacheKey.OLD_DETAIL.getMessage(); |
|
|
|
if(couponChannelIdL > 0){ |
|
|
|
key = key + couponChannelIdL; |
|
|
|
}else if(couponIdL > 0){ |
|
|
|
key = key + couponIdL; |
|
|
|
} |
|
|
|
return RedisCacheUtils.getCacheObject(template, key,WxCouponCVo.class); |
|
|
|
} |
|
|
|
|
|
|
|
} |