mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-05 01:25:58 +08:00
pb update
This commit is contained in:
@@ -45,6 +45,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry, rdb redis.Universal
|
||||
userRouterGroupChildToken.POST("/get_all_users_uid", u.GetAllUsersID) // todo
|
||||
userRouterGroupChildToken.POST("/account_check", u.AccountCheck) // todo
|
||||
userRouterGroupChildToken.POST("/get_users", u.GetUsers)
|
||||
userRouterGroupChildToken.POST("/get_users_online_status", u.GetUsersOnlineStatus)
|
||||
}
|
||||
//friend routing group
|
||||
friendRouterGroup := r.Group("/friend")
|
||||
@@ -141,7 +142,7 @@ func NewGinRouter(zk discoveryregistry.SvcDiscoveryRegistry, rdb redis.Universal
|
||||
|
||||
msgGroup.POST("/batch_send_msg", m.ManagementBatchSendMsg)
|
||||
msgGroup.POST("/check_msg_is_send_success", m.CheckMsgIsSendSuccess)
|
||||
msgGroup.POST("/get_users_online_status", m.GetUsersOnlineStatus)
|
||||
|
||||
//msgGroup.POST("/set_message_reaction_extensions", msg.SetMessageReactionExtensions)
|
||||
//msgGroup.POST("/get_message_list_reaction_extensions", msg.GetMessageListReactionExtensions)
|
||||
//msgGroup.POST("/add_message_reaction_extensions", msg.AddMessageReactionExtensions)
|
||||
|
||||
@@ -2,6 +2,10 @@ package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/a2r"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||
@@ -55,3 +59,15 @@ func (u *User) AccountCheck(c *gin.Context) {
|
||||
func (u *User) GetUsers(c *gin.Context) {
|
||||
a2r.Call(user.UserClient.GetPaginationUsers, u.client, c)
|
||||
}
|
||||
func (u *User) GetUsersOnlineStatus(c *gin.Context) {
|
||||
params := apistruct.ManagementSendMsgReq{}
|
||||
if err := c.BindJSON(¶ms); err != nil {
|
||||
apiresp.GinError(c, errs.ErrArgs.WithDetail(err.Error()).Wrap())
|
||||
return
|
||||
}
|
||||
if !tokenverify.IsAppManagerUid(c) {
|
||||
apiresp.GinError(c, errs.ErrNoPermission.Wrap("only app manager can send message"))
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user