From f3f6e43e3404c834bca90aaa7815c05194d156de Mon Sep 17 00:00:00 2001 From: Lansong <2095621390@qq.com> Date: Sun, 31 Mar 2024 14:26:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=B2=E8=AF=BB?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9B=B4=E6=96=B0=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- biz/application/service/system.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/biz/application/service/system.go b/biz/application/service/system.go index 597cc74..26230b8 100644 --- a/biz/application/service/system.go +++ b/biz/application/service/system.go @@ -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, ¬ificationcountmapper.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, ¬ificationcountmapper.NotificationCount{ + ID: uid, + Read: cnt, + }); err != nil { + return resp, err + } } - return resp, nil }