mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-05-03 16:26:36 +08:00
1
This commit is contained in:
parent
7b10b17056
commit
69e94c25f4
@ -4,7 +4,6 @@ import (
|
||||
common "Open_IM/internal/api_to_rpc"
|
||||
api "Open_IM/pkg/base_info"
|
||||
"Open_IM/pkg/common/config"
|
||||
"Open_IM/pkg/common/token_verify"
|
||||
rpc "Open_IM/pkg/proto/friend"
|
||||
"Open_IM/pkg/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -13,20 +12,20 @@ import (
|
||||
// 不一致
|
||||
func AddBlacklist(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.AddBlacklistReq{}, &api.AddBlacklistResp{},
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName())
|
||||
}
|
||||
|
||||
func ImportFriend1(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.ImportFriendReq{}, &api.ImportFriendResp{},
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName())
|
||||
}
|
||||
|
||||
func AddFriend1(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.AddFriendReq{}, &api.AddFriendResp{},
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName())
|
||||
}
|
||||
|
||||
func AddFriendResponse1(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.AddFriendResponseReq{}, &api.AddFriendResponseResp{},
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName(), token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImFriendName, rpc.NewFriendClient, utils.GetSelfFuncName())
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ func InviteUserToGroup(c *gin.Context) {
|
||||
|
||||
func NewCreateGroup(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.CreateGroupReq{}, &api.CreateGroupResp{},
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "CreateGroup", token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "CreateGroup")
|
||||
}
|
||||
|
||||
// @Summary 获取用户收到的加群信息列表
|
||||
@ -515,7 +515,7 @@ func GetRecvGroupApplicationList(c *gin.Context) {
|
||||
// @Router /group/get_user_req_group_applicationList [post]
|
||||
func GetUserReqGroupApplicationList(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.GetUserReqGroupApplicationListReq{}, &api.GetUserRespGroupApplicationResp{},
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "GetGroupApplicationList", token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "GetGroupApplicationList")
|
||||
}
|
||||
|
||||
// @Summary 通过群ID列表获取群信息
|
||||
@ -803,7 +803,7 @@ func QuitGroup(c *gin.Context) {
|
||||
|
||||
func NewSetGroupInfo(c *gin.Context) {
|
||||
common.ApiToRpc(c, &api.SetGroupInfoReq{}, &api.SetGroupInfoResp{},
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "SetGroupInfo", token_verify.ParseUserIDFromToken)
|
||||
config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, "SetGroupInfo")
|
||||
}
|
||||
|
||||
func argsHandle(params *api.SetGroupInfoReq, req *rpc.SetGroupInfoReq) {
|
||||
@ -1263,7 +1263,7 @@ func GetGroupAbstractInfo(c *gin.Context) {
|
||||
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(), nil)
|
||||
common.ApiToRpc(c, &api.GetGroupAbstractInfoReq{}, &GetGroupAbstractInfoResp{}, config.Config.RpcRegisterName.OpenImGroupName, rpc.NewGroupClient, utils.GetSelfFuncName())
|
||||
|
||||
//var (
|
||||
//req api.GetGroupAbstractInfoReq
|
||||
|
@ -65,7 +65,7 @@ func WriteErrorResponse(ctx context.Context, funcName string, err error, args ..
|
||||
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": t.ErrCode, "errMsg": t.ErrMsg, "errDtl": t.DetailErrMsg})
|
||||
return
|
||||
default:
|
||||
s, ok := status.FromError(err)
|
||||
s, ok := status.FromError(e)
|
||||
if !ok {
|
||||
ctx.Value(TraceLogKey).(*ApiInfo).GinCtx.JSON(http.StatusOK, gin.H{"errCode": constant.ErrDefaultOther.ErrCode, "errMsg": err.Error(), "errDtl": fmt.Sprintf("%+v", err)})
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user