From e8d9cdc63d1b1799024b2def6bbdc2da6c920aa5 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 14 Jul 2023 12:14:51 +0800 Subject: [PATCH] new feature: add batch send msg --- internal/api/msg.go | 2 ++ pkg/apistruct/msg.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index ee17f80a7..32fdc4e9a 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -203,6 +203,7 @@ func (m *MessageApi) SendMessage(c *gin.Context) { apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) return } + log.ZInfo(c, "SendMessage", "req", req) if !tokenverify.IsAppManagerUid(c) { apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message")) return @@ -241,6 +242,7 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) { apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) return } + log.ZInfo(c, "BatchSendMsg", "req", req) if err := tokenverify.CheckAdmin(c); err != nil { apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message")) return diff --git a/pkg/apistruct/msg.go b/pkg/apistruct/msg.go index 179c7f872..a0c5e1429 100644 --- a/pkg/apistruct/msg.go +++ b/pkg/apistruct/msg.go @@ -73,7 +73,7 @@ type CustomElem struct { Extension string `mapstructure:"extension"` } type TextElem struct { - Content string `mapstructure:"content" validate:"required"` + Text string `mapstructure:"text" validate:"required"` } type RevokeElem struct {