diff --git a/internal/api/msg.go b/internal/api/msg.go index 7a38068a4..271cde349 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -467,6 +467,10 @@ func (m *MessageApi) SendSimpleMessage(c *gin.Context) { sessionType int32 recvID string ) + if err = c.BindJSON(&req); err != nil { + apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) + return + } err = json.Unmarshal(decodedData, &keyMsgData) if err != nil { apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap()) diff --git a/internal/api/router.go b/internal/api/router.go index 7c2c78c7d..ac7edb24d 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -253,6 +253,7 @@ func newGinRouter(ctx context.Context, client discovery.Conn, cfg *Config) (*gin msgGroup.POST("/delete_msg_physical", m.DeleteMsgPhysical) msgGroup.POST("/batch_send_msg", m.BatchSendMsg) + msgGroup.POST("/send_simple_msg", m.SendSimpleMessage) msgGroup.POST("/check_msg_is_send_success", m.CheckMsgIsSendSuccess) msgGroup.POST("/get_server_time", m.GetServerTime) }