mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package msg
|
|
|
|
import (
|
|
"Open_IM/pkg/common/constant"
|
|
"Open_IM/pkg/common/log"
|
|
pbOffice "Open_IM/pkg/proto/office"
|
|
"Open_IM/pkg/utils"
|
|
"github.com/golang/protobuf/jsonpb"
|
|
"github.com/golang/protobuf/proto"
|
|
)
|
|
|
|
func WorkMomentSendNotification(operationID, sendID, recvID string, notificationMsg *pbOffice.WorkMomentNotificationMsg) {
|
|
log.NewInfo(operationID, utils.GetSelfFuncName(), sendID, recvID, notificationMsg)
|
|
WorkMomentNotification(operationID, sendID, recvID, notificationMsg)
|
|
}
|
|
|
|
func WorkMomentNotification(operationID, sendID, recvID string, m proto.Message) {
|
|
//var tips open_im_sdk.TipsComm
|
|
marshaler := jsonpb.Marshaler{
|
|
OrigName: true,
|
|
EnumsAsInts: false,
|
|
EmitDefaults: false,
|
|
}
|
|
JsonDetail, _ := marshaler.MarshalToString(m)
|
|
n := &NotificationMsg{
|
|
SendID: sendID,
|
|
RecvID: recvID,
|
|
MsgFrom: constant.UserMsgType,
|
|
ContentType: constant.WorkMomentNotification,
|
|
SessionType: constant.SingleChatType,
|
|
OperationID: operationID,
|
|
}
|
|
n.Content = []byte(JsonDetail)
|
|
log.NewInfo(operationID, utils.GetSelfFuncName(), JsonDetail)
|
|
Notification(n)
|
|
}
|