This commit is contained in:
withchao 2023-01-12 14:31:44 +08:00
parent 3b82fbe4ca
commit 20aea0c335
2 changed files with 11 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/log"
"Open_IM/pkg/common/middleware"
"Open_IM/pkg/common/token_verify"
"Open_IM/pkg/utils"
"flag"
"fmt"
@ -97,6 +98,14 @@ func main() {
}
//group related routing group
groupRouterGroup := r.Group("/group")
groupRouterGroup.Use(func(c *gin.Context) {
userID, err := token_verify.ParseUserIDFromToken(c.GetHeader("token"), c.MustGet("operationID").(string))
if err != nil {
c.String(400, err.Error())
return
}
c.Set("opUserID", userID)
})
{
groupRouterGroup.POST("/create_group", group.NewCreateGroup) //1
groupRouterGroup.POST("/set_group_info", group.NewSetGroupInfo) //1

View File

@ -1262,7 +1262,8 @@ func GetGroupAbstractInfo(c *gin.Context) {
GroupMemberNumber int32 `json:"groupMemberNumber"`
GroupMemberListHash uint64 `json:"groupMemberListHash"`
}
common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
//common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName(), nil)
//var (
//req api.GetGroupAbstractInfoReq