diff --git a/internal/api/msg.go b/internal/api/msg.go index 2bbae9765..726889d56 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -170,12 +170,7 @@ func (m *MessageApi) getSendMsgReq(c *gin.Context, req apistruct.SendMsg) (sendM log.ZDebug(c, "getSendMsgReq", "req", req.Content) switch req.ContentType { case constant.Text: - text, ok := req.Content["text"].(string) - if !ok { - return nil, errs.ErrArgs.WithDetail("text is not string") - } - data = apistruct.TextContentElem{Content: text} - log.ZDebug(c, "getSendMsgReq", "data", data) + data = apistruct.TextElem{} case constant.Picture: data = apistruct.PictureElem{} case constant.Voice: diff --git a/pkg/apistruct/msg.go b/pkg/apistruct/msg.go index d31752f38..12cf253a0 100644 --- a/pkg/apistruct/msg.go +++ b/pkg/apistruct/msg.go @@ -72,11 +72,8 @@ type CustomElem struct { Description string `mapstructure:"description"` Extension string `mapstructure:"extension"` } -type TextElem struct { - Text string `mapstructure:"text" validate:"required"` -} -type TextContentElem struct { +type TextElem struct { Content string `json:"content" validate:"required"` }