From 4f81302c3fa86d03312c2bab5d0da45fca8a4183 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 28 Feb 2023 21:32:31 +0800 Subject: [PATCH] update --- internal/logic/domain/message/service/message_service.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/logic/domain/message/service/message_service.go b/internal/logic/domain/message/service/message_service.go index 70ec00f..facd094 100644 --- a/internal/logic/domain/message/service/message_service.go +++ b/internal/logic/domain/message/service/message_service.go @@ -190,13 +190,19 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser sender.Nickname = sendUser.Nickname sender.AvatarUrl = sendUser.AvatarUrl } + var pushContent string + if req.MessageType != pb.MessageType_MT_TEXT { + pushContent = "您收到一条" + req.MessageType.String() + "消息" + } else { + pushContent = string(req.MessageContent) + } //TODO::接收者类型为`user`, 进行极光推送 CommAddPush(md.PushParams{ MasterId: masterId, Uid: uid, PushAlia: alia, Title: sender.Nickname, - Content: string(req.MessageContent), + Content: pushContent, //Content: "您收到一条新消息,来自会员\"[消息发送者-会员昵称]\",发送时间\"[时间]\"", //Content: "您收到一条新消息,来自会员\"[消息发送者-会员昵称]\",发送时间\"[时间]\",消息类型\"[消息类型]\",备注\"[备注]\"", PushType: "zhi_ying_gim",