Skip to content

Commit

Permalink
Merge pull request #21 from ShanghaitechGeekPie/feat-show-reward
Browse files Browse the repository at this point in the history
feat(controllers/comments.GenerateResponse): disclose reward
  • Loading branch information
WAAutoMaton authored May 11, 2024
2 parents 9872915 + b562551 commit e911aeb
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions internal/controllers/comments/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ func GenerateResponse(comments []models.Comment, uid uint, likeResult []CommentL
CoverReason: v.CoverReason,
Reward: v.Reward,
}
// 该评论未设置匿名,或者是自己的评论,则显示用户信息
currentUser, err := queries.GetUserByID(nil, uid)
if err != nil {
c.Reward = -2
} else if !currentUser.IsAdmin && !currentUser.IsCommunityAdmin {
c.Reward = -1
}
if !anonymous || v.User.ID == uid {
t, _ := queries.GetProfile(nil, v.UserID, uid)
c.User = &t
Expand Down

0 comments on commit e911aeb

Please sign in to comment.