记得上下班打卡 | git大法好,push需谨慎

Commit a15aa019 authored by GaoHu's avatar GaoHu

exit

parent f0a1d8e9
......@@ -167,7 +167,8 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//goblinMongoUtils.setGoblinGoodsAnticipateShareVo(goblinGoodsAnticipateShareVo);
//redis缓存
goblinRedisUtils.setShare(skuId, uid, sid);
Duration between = Duration.between(valueBySkuId.getAboutStartDate(), valueBySkuId.getAboutEndDate());
goblinRedisUtils.setShare(skuId, uid, sid,between.toDays());
//redis存储用户分享
goblinRedisUtils.setShareVo(goblinGoodsAnticipateShareVo);
......@@ -193,7 +194,7 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
//查询是否可以预约
GoblinGoodsAnticipateShareVo shareVo = goblinRedisUtils.getShareVo(sid);
if (shareVo == null) {
return ResponseDto.failure("分享不存在!");
return ResponseDto.failure("分享不存在,!");
}
Integer integer = GoblinAnticipateUtils.setState(shareVo.getAboutStartDate(), shareVo.getAboutEndDate());
if (integer != null && !integer.equals(1)) {
......@@ -254,9 +255,12 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public ResponseDto<HelpValueVo> getHelpValue(String sid) {
//获取分享助力信息
GoblinGoodsAnticipateShareVo shareVo = goblinRedisUtils.getShareVo(sid);
HelpValueVo helpValueVo = HelpValueVo.getNew();
helpValueVo.copy(shareVo);
return ResponseDto.success(helpValueVo);
if (shareVo != null) {
HelpValueVo helpValueVo = HelpValueVo.getNew();
helpValueVo.copy(shareVo);
return ResponseDto.success(helpValueVo);
}
return ResponseDto.failure("该助力不存在!");
}
@Override
......
......@@ -160,9 +160,9 @@ public class GoblinRedisUtils {
/**
* 存用户助力关联
*/
public void setShare(String skuId, String uid, String sid) {
public void setShare(String skuId, String uid, String sid,Long day) {
String key = GoblinRedisConst.ANTICIPATE_SHARE_UID_SKUID.concat(uid).concat(":").concat(skuId);
redisUtil.set(key, sid);
redisUtil.set(key, sid,(day + 1) * 60 * 60 * 24);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment