From 338acfba759ae93d4221a2940cab00566ab58be7 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 26 Apr 2022 14:57:15 +0800 Subject: [PATCH] cache rpc --- internal/rpc/office/office.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 869a03362..674dcf773 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -398,7 +398,7 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn CreateTime: int32(time.Now().Unix()), } // send notification - if like { + if like && workMoment.UserID != req.UserID { msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) @@ -450,7 +450,9 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com Content: comment.Content, CreateTime: comment.CreateTime, } - msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) + if req.UserID != workMoment.UserID { + msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg) + } if req.ReplyUserID != "" { msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg) }