|
@@ -203,7 +203,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
userIdListValue.add(Math.toIntExact(userId));
|
|
|
RedisUtils.setCacheList(likeOneKey, userIdListValue);
|
|
|
//给数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间 key=like_one_count_time:{文章id}#{数量}
|
|
|
- RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + 1, 1, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + 1, 1, Duration.ofSeconds(5));
|
|
|
//给该用户点赞文章的key添加值
|
|
|
communityIdList.add(Math.toIntExact(targetId));
|
|
|
RedisUtils.setCacheList(myLikeOneKey, communityIdList);
|
|
@@ -240,7 +240,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
userIdListValue.add(Math.toIntExact(userId));
|
|
|
RedisUtils.setCacheList(likeTwoKey, userIdListValue);
|
|
|
//给数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间
|
|
|
- RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + 1, 1, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + 1, 1, Duration.ofSeconds(5));
|
|
|
//给该用户点赞回复的key添加值
|
|
|
communityIdList.add(Math.toIntExact(targetId));
|
|
|
RedisUtils.setCacheList(myLikeTwoKey, communityIdList);
|
|
@@ -288,7 +288,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
likeOneCount = likeOneCount + 1;
|
|
|
RedisUtils.setCacheObject(likeOneCountKey, likeOneCount);
|
|
|
//新增数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间
|
|
|
- RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + likeOneCount, likeOneCount, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + likeOneCount, likeOneCount, Duration.ofSeconds(5));
|
|
|
return R.ok();
|
|
|
} else {
|
|
|
// 社区资讯文章回复的人员集合的key key = TWO_LIKE:{targetId} value = [userId,userId];
|
|
@@ -314,7 +314,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
likeTwoCount = likeTwoCount + 1;
|
|
|
RedisUtils.setCacheObject(likeTwoCountKey, likeTwoCount);
|
|
|
//新增数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间
|
|
|
- RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + likeTwoCount, likeTwoCount, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + likeTwoCount, likeTwoCount, Duration.ofSeconds(5));
|
|
|
return R.ok();
|
|
|
}
|
|
|
}
|
|
@@ -367,7 +367,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
likeCount = likeCount -1;
|
|
|
RedisUtils.setCacheObject(likeOneCountKey, Math.max(likeCount, 0));
|
|
|
//给数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间
|
|
|
- RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + likeCount, likeCount, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeOneCountTimeKey + "#" + likeCount, likeCount, Duration.ofSeconds(5));
|
|
|
return R.ok();
|
|
|
} else {
|
|
|
//评论的删除
|
|
@@ -405,7 +405,7 @@ public class CommentLikesServiceImpl implements ICommentLikesService {
|
|
|
likeCount = likeCount - 1;
|
|
|
RedisUtils.setCacheObject(likeTwoCountKey, Math.max(likeCount, 0));
|
|
|
//给数据库同步数据在 redis中增加一个有过期时间的key 1分钟过期时间
|
|
|
- RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + likeCount, likeCount, Duration.ofSeconds(1));
|
|
|
+ RedisUtils.setCacheObject(likeTwoCountTimeKey + "#" + likeCount, likeCount, Duration.ofSeconds(5));
|
|
|
return R.ok();
|
|
|
}
|
|
|
}
|