Skip to content

Commit 74f503e

Browse files
chore: mirror change for comment like count (X-Engineer#62)
调整评论点赞数的随机值范围,避免真机 app 显示页面,评论点赞与 '回复' 重叠
1 parent a790543 commit 74f503e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: service/commentServiceImpl.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (commentService *CommentServiceImpl) CommentAction(comment dao.Comment) (Co
4949
User: user,
5050
Content: commentRes.Content,
5151
CreateDate: commentRes.CreatedAt.Format(config.GO_STARTER_TIME),
52-
LikeCount: int64(rand.Intn(10000)),
52+
LikeCount: int64(rand.Intn(100)),
5353
TeaseCount: int64(rand.Intn(100)),
5454
}
5555
// redis操作:将发表的评论id存入redis
@@ -193,7 +193,7 @@ func (commentService *CommentServiceImpl) CombineComment(comment *Comment, plain
193193
comment.Id = plainComment.Id
194194
comment.Content = plainComment.Content
195195
comment.CreateDate = plainComment.CreatedAt.Format(config.GO_STARTER_TIME)
196-
comment.LikeCount = int64(rand.Intn(10000))
196+
comment.LikeCount = int64(rand.Intn(100))
197197
comment.TeaseCount = int64(rand.Intn(100))
198198
return nil
199199
}

0 commit comments

Comments
 (0)