From 21cc4826b52ffd8d789b454b23f4e85eed2022fa Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 28 Feb 2023 21:41:19 +0800 Subject: [PATCH] update --- .../domain/message/service/message_service.go | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/internal/logic/domain/message/service/message_service.go b/internal/logic/domain/message/service/message_service.go index facd094..5fc6200 100644 --- a/internal/logic/domain/message/service/message_service.go +++ b/internal/logic/domain/message/service/message_service.go @@ -192,10 +192,36 @@ func (*messageService) SendToUser(ctx context.Context, sender *pb.Sender, toUser } var pushContent string if req.MessageType != pb.MessageType_MT_TEXT { - pushContent = "您收到一条" + req.MessageType.String() + "消息" + switch req.MessageType { + case pb.MessageType_MT_UNKNOWN: + pushContent = "您收到一条\"未知\"消息" + break + case pb.MessageType_MT_FACE: + pushContent = "您收到一条表情消息" + break + case pb.MessageType_MT_VOICE: + pushContent = "您收到一条语音消息" + break + case pb.MessageType_MT_IMAGE: + pushContent = "您收到一条图片消息" + break + case pb.MessageType_MT_FILE: + pushContent = "您收到一条视频消息" + break + case pb.MessageType_MT_LOCATION: + pushContent = "您收到一条地理位置消息" + break + case pb.MessageType_MT_COMMAND: + pushContent = "您收到一条指令推送消息" + break + case pb.MessageType_MT_CUSTOM: + pushContent = "您收到一条\"自定义\"推送消息" + break + } } else { pushContent = string(req.MessageContent) } + //TODO::接收者类型为`user`, 进行极光推送 CommAddPush(md.PushParams{ MasterId: masterId,