mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
refactor: notification data struct change
This commit is contained in:
parent
9614d1f31b
commit
a6e6476fef
@ -135,11 +135,11 @@ func (m *MsgClient) PullMessageBySeqList(ctx context.Context, req *sdkws.PullMes
|
|||||||
}
|
}
|
||||||
|
|
||||||
type NotificationElem struct {
|
type NotificationElem struct {
|
||||||
Detail interface{} `json:"detail,omitempty"`
|
Detail string `json:"detail,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *MsgClient) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
func (c *MsgClient) Notification(ctx context.Context, sendID, recvID string, contentType int32, m proto.Message, opts ...utils.OptionsOpt) error {
|
||||||
n := NotificationElem{Detail: m}
|
n := NotificationElem{Detail: utils.StructToJsonString(m)}
|
||||||
content, err := json.Marshal(n)
|
content, err := json.Marshal(n)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
|
log.ZError(ctx, "MsgClient Notification json.Marshal failed", err, "sendID", sendID, "recvID", recvID, "contentType", contentType, "msg", m)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user