pb update

This commit is contained in:
Gordon
2023-05-06 10:27:07 +08:00
parent 72aa6d5eab
commit 8d998ad63c
5 changed files with 28 additions and 12 deletions
+2 -1
View File
@@ -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)
+16
View File
@@ -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(&params); 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
}
}