feat: 帖子收藏与用户关注
- 新增收藏功能:favorite 服务与 handler、FavoriteButton 组件 - 新增关注功能:follow 服务与 handler、FollowButton 组件 - 用户主页适配关注/粉丝与收藏展示 - flash 消息工具、广告与侧边栏组件微调
This commit is contained in:
@@ -88,6 +88,7 @@ func (h *Handlers) PostDetail(c *gin.Context) {
|
||||
}
|
||||
if claims != nil {
|
||||
post.Liked = h.Like.HasLiked(post.ID, claims.ID)
|
||||
post.Favorited = h.Favorite.HasFavorited(post.ID, claims.ID)
|
||||
}
|
||||
h.attachNecroReplyHint(claims, post)
|
||||
c.JSON(http.StatusOK, gin.H{"post": post})
|
||||
@@ -275,6 +276,7 @@ func (h *Handlers) UnlockPostPassword(c *gin.Context) {
|
||||
}
|
||||
if claims != nil {
|
||||
post.Liked = h.Like.HasLiked(post.ID, claims.ID)
|
||||
post.Favorited = h.Favorite.HasFavorited(post.ID, claims.ID)
|
||||
}
|
||||
h.attachNecroReplyHint(claims, post)
|
||||
c.JSON(http.StatusOK, gin.H{"post": post})
|
||||
|
||||
Reference in New Issue
Block a user