new feature: add batch send msg

pull/560/head
wangchuxiao 2 years ago
parent 0d406fa95b
commit e8d9cdc63d

@ -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

@ -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 {

Loading…
Cancel
Save