mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-25 19:22:46 +08:00
cache rpc
This commit is contained in:
parent
69c46f684f
commit
490f4f36f1
@ -10,12 +10,9 @@ import (
|
|||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func WorkMomentSendNotification(operationID, sendID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) {
|
func WorkMomentSendNotification(operationID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) {
|
||||||
log.NewInfo(operationID, utils.GetSelfFuncName(), sendID, recvID, notificationMsg)
|
log.NewInfo(operationID, utils.GetSelfFuncName(), recvID, notificationMsg)
|
||||||
if sendID == recvID {
|
WorkMomentNotification(operationID, recvID, recvID, notificationMsg)
|
||||||
return
|
|
||||||
}
|
|
||||||
WorkMomentNotification(operationID, sendID, recvID, notificationMsg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message) {
|
func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message) {
|
||||||
|
@ -305,7 +305,7 @@ func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.Crea
|
|||||||
UserName: createUser.Nickname,
|
UserName: createUser.Nickname,
|
||||||
CreateTime: workMoment.CreateTime,
|
CreateTime: workMoment.CreateTime,
|
||||||
}
|
}
|
||||||
msg.WorkMomentSendNotification(req.OperationID, req.WorkMoment.UserID, atUser.UserID, workMomentNotificationMsg)
|
msg.WorkMomentSendNotification(req.OperationID, atUser.UserID, workMomentNotificationMsg)
|
||||||
}
|
}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
return resp, nil
|
return resp, nil
|
||||||
@ -399,7 +399,7 @@ func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOn
|
|||||||
}
|
}
|
||||||
// send notification
|
// send notification
|
||||||
if like {
|
if like {
|
||||||
msg.WorkMomentSendNotification(req.OperationID, req.UserID, workMoment.UserID, workMomentNotificationMsg)
|
msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||||
}
|
}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
return resp, nil
|
return resp, nil
|
||||||
@ -450,9 +450,9 @@ func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.Com
|
|||||||
Content: comment.Content,
|
Content: comment.Content,
|
||||||
CreateTime: comment.CreateTime,
|
CreateTime: comment.CreateTime,
|
||||||
}
|
}
|
||||||
msg.WorkMomentSendNotification(req.OperationID, req.UserID, workMoment.UserID, workMomentNotificationMsg)
|
msg.WorkMomentSendNotification(req.OperationID, workMoment.UserID, workMomentNotificationMsg)
|
||||||
if req.ReplyUserID != "" {
|
if req.ReplyUserID != "" {
|
||||||
msg.WorkMomentSendNotification(req.OperationID, req.UserID, req.ReplyUserID, workMomentNotificationMsg)
|
msg.WorkMomentSendNotification(req.OperationID, req.ReplyUserID, workMomentNotificationMsg)
|
||||||
}
|
}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user