mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-19 12:47:06 +08:00
new feature: add batch send msg
This commit is contained in:
parent
0d406fa95b
commit
e8d9cdc63d
@ -203,6 +203,7 @@ func (m *MessageApi) SendMessage(c *gin.Context) {
|
|||||||
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.ZInfo(c, "SendMessage", "req", req)
|
||||||
if !tokenverify.IsAppManagerUid(c) {
|
if !tokenverify.IsAppManagerUid(c) {
|
||||||
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
||||||
return
|
return
|
||||||
@ -241,6 +242,7 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
|
|||||||
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.ZInfo(c, "BatchSendMsg", "req", req)
|
||||||
if err := tokenverify.CheckAdmin(c); err != nil {
|
if err := tokenverify.CheckAdmin(c); err != nil {
|
||||||
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
||||||
return
|
return
|
||||||
|
|||||||
@ -73,7 +73,7 @@ type CustomElem struct {
|
|||||||
Extension string `mapstructure:"extension"`
|
Extension string `mapstructure:"extension"`
|
||||||
}
|
}
|
||||||
type TextElem struct {
|
type TextElem struct {
|
||||||
Content string `mapstructure:"content" validate:"required"`
|
Text string `mapstructure:"text" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RevokeElem struct {
|
type RevokeElem struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user