Skip to content

Commit

Permalink
fix: 修复已读信息更新错误的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Lansongxx committed Mar 31, 2024
1 parent a96e788 commit f3f6e43
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions biz/application/service/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ func (s *SystemServiceImpl) GetNotifications(ctx context.Context, req *gensystem
resp.Token = *p.LastToken
}

uid, _ := primitive.ObjectIDFromHex(req.UserId)
if err = s.NotificationCountMongoMapper.UpdateNotificationCount(ctx, &notificationcountmapper.NotificationCount{
ID: uid,
Read: cnt,
}); err != nil {
return resp, err
if req.OnlyType == nil {
uid, _ := primitive.ObjectIDFromHex(req.UserId)
if err = s.NotificationCountMongoMapper.UpdateNotificationCount(ctx, &notificationcountmapper.NotificationCount{
ID: uid,
Read: cnt,
}); err != nil {
return resp, err
}
}

return resp, nil
}

Expand Down

0 comments on commit f3f6e43

Please sign in to comment.