You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/rpc/msg/work_moments_notification.go

32 lines
925 B

3 years ago
package msg
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/log"
3 years ago
pbOffice "Open_IM/pkg/proto/office"
3 years ago
"Open_IM/pkg/utils"
3 years ago
"github.com/golang/protobuf/proto"
3 years ago
)
3 years ago
func WorkMomentSendNotification(operationID, sendID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) {
log.NewInfo(operationID, utils.GetSelfFuncName(), recvID)
bytes, err := proto.Marshal(notificationMsg)
3 years ago
if err != nil {
3 years ago
log.NewError(operationID, utils.GetSelfFuncName(), "proto marshal failed", err.Error())
3 years ago
}
3 years ago
WorkMomentNotification(operationID, sendID, recvID, bytes)
}
func WorkMomentNotification(operationID, sendID, recvID string, content []byte) {
n := &NotificationMsg{
SendID: sendID,
RecvID: recvID,
Content: content,
MsgFrom: constant.UserMsgType,
ContentType: constant.WorkMomentNotification,
SessionType: constant.UserMsgType,
OperationID: operationID,
3 years ago
}
3 years ago
Notification(n)
3 years ago
}