From fb9ab25de1e8f93db9e007ed3bef1fb201f35078 Mon Sep 17 00:00:00 2001 From: Gordon <46924906+FGadvancer@users.noreply.github.com> Date: Thu, 19 Oct 2023 21:48:10 +0800 Subject: [PATCH] fix: api send messages for notification conversation. --- internal/api/msg.go | 3 ++- internal/push/push_handler.go | 1 - pkg/apistruct/manage.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index 47aa84031..fefe2218d 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -173,7 +173,8 @@ func (m *MessageApi) getSendMsgReq(c *gin.Context, req apistruct.SendMsg) (sendM data = apistruct.OANotificationElem{} req.SessionType = constant.NotificationChatType if !authverify.IsManagerUserID(req.SendID) { - return nil, errs.ErrNoPermission.Wrap("only app manager can send message") + return nil, errs.ErrNoPermission. + Wrap("only app manager can as sender send OANotificationElem") } case constant.CustomNotTriggerConversation: data = apistruct.CustomElem{} diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go index 9efa15855..a1a9ff08e 100644 --- a/internal/push/push_handler.go +++ b/internal/push/push_handler.go @@ -56,7 +56,6 @@ func (c *ConsumerHandler) handleMs2PsChat(ctx context.Context, msg []byte) { MsgData: msgFromMQ.MsgData, ConversationID: msgFromMQ.ConversationID, } - log.ZDebug(ctx, "push msg", "msg", pbData.String()) sec := msgFromMQ.MsgData.SendTime / 1000 nowSec := utils.GetCurrentTimestampBySecond() log.ZDebug(ctx, "push msg", "msg", pbData.String(), "sec", sec, "nowSec", nowSec) diff --git a/pkg/apistruct/manage.go b/pkg/apistruct/manage.go index 7d30d2151..1238b4757 100644 --- a/pkg/apistruct/manage.go +++ b/pkg/apistruct/manage.go @@ -41,7 +41,7 @@ type SendMsgReq struct { type BatchSendMsgReq struct { SendMsg IsSendAll bool `json:"isSendAll"` - RecvIDs []string `json:"recvIDs"` + RecvIDs []string `json:"recvIDs" binding:"required"` } type BatchSendMsgResp struct {