mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-08-30 02:30:01 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
This commit is contained in:
commit
635c703535
@ -880,14 +880,20 @@ func (s *groupServer) GetGroupsInfo(ctx context.Context, req *pbGroup.GetGroupsI
|
|||||||
return &resp, nil
|
return &resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckPermission(ctx context.Context, groupID string, userID string) error {
|
func CheckPermission(ctx context.Context, groupID string, userID string) (err error) {
|
||||||
|
defer func() {
|
||||||
|
trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "groupID", groupID, "userID", userID)
|
||||||
|
}()
|
||||||
|
if !token_verify.IsManagerUserID(userID) && !imdb.IsGroupOwnerAdmin(groupID, userID) {
|
||||||
|
return constant.ErrNoPermission
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) {
|
func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) {
|
||||||
trace_log.SetRpcReqInfo(trace_log.NewRpcCtx(ctx, utils.GetSelfFuncName(), req.OperationID), utils.GetSelfFuncName(), req.String())
|
trace_log.SetRpcReqInfo(trace_log.NewRpcCtx(ctx, utils.GetSelfFuncName(), req.OperationID), utils.GetSelfFuncName(), req.String())
|
||||||
defer trace_log.ShowLog(ctx)
|
defer trace_log.ShowLog(ctx)
|
||||||
resp := pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}
|
resp := pbGroup.GroupApplicationResponseResp{CommonResp: &open_im_sdk.CommonResp{}}
|
||||||
if err := CheckPermission(ctx, req.GroupID, req.OpUserID); err != nil {
|
if err := CheckPermission(ctx, req.GroupID, req.OpUserID); err != nil {
|
||||||
SetErrorForResp(err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
SetErrorForResp(err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
||||||
return &resp, nil
|
return &resp, nil
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -48,7 +48,7 @@ message SetGroupInfoReq{
|
|||||||
string OperationID = 3;
|
string OperationID = 3;
|
||||||
}
|
}
|
||||||
message SetGroupInfoResp{
|
message SetGroupInfoResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ message GetUserReqApplicationListReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetUserReqApplicationListResp{
|
message GetUserReqApplicationListResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
repeated server_api_params.GroupRequest GroupRequestList = 2;
|
repeated server_api_params.GroupRequest GroupRequestList = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ message TransferGroupOwnerReq {
|
|||||||
string OpUserID = 5; //app manager or group owner
|
string OpUserID = 5; //app manager or group owner
|
||||||
}
|
}
|
||||||
message TransferGroupOwnerResp{
|
message TransferGroupOwnerResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message JoinGroupReq{
|
message JoinGroupReq{
|
||||||
@ -96,7 +96,7 @@ message JoinGroupReq{
|
|||||||
|
|
||||||
}
|
}
|
||||||
message JoinGroupResp{
|
message JoinGroupResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ message GroupApplicationResponseReq{
|
|||||||
int32 HandleResult = 6;
|
int32 HandleResult = 6;
|
||||||
}
|
}
|
||||||
message GroupApplicationResponseResp{
|
message GroupApplicationResponseResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ message QuitGroupReq{
|
|||||||
string OpUserID = 3;
|
string OpUserID = 3;
|
||||||
}
|
}
|
||||||
message QuitGroupResp{
|
message QuitGroupResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ message GetGroupsResp {
|
|||||||
repeated CMSGroup CMSGroups = 1;
|
repeated CMSGroup CMSGroups = 1;
|
||||||
server_api_params.ResponsePagination Pagination = 2;
|
server_api_params.ResponsePagination Pagination = 2;
|
||||||
int32 GroupNum = 3;
|
int32 GroupNum = 3;
|
||||||
CommonResp commonResp = 4;
|
server_api_params.CommonResp commonResp = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupMemberReq {
|
message GetGroupMemberReq {
|
||||||
@ -250,7 +250,7 @@ message GetGroupMembersCMSResp {
|
|||||||
repeated server_api_params.GroupMemberFullInfo members = 1;
|
repeated server_api_params.GroupMemberFullInfo members = 1;
|
||||||
server_api_params.ResponsePagination Pagination = 2;
|
server_api_params.ResponsePagination Pagination = 2;
|
||||||
int32 MemberNums = 3;
|
int32 MemberNums = 3;
|
||||||
CommonResp commonResp = 4;
|
server_api_params.CommonResp commonResp = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DismissGroupReq{
|
message DismissGroupReq{
|
||||||
@ -260,7 +260,7 @@ message DismissGroupReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DismissGroupResp{
|
message DismissGroupResp{
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ message MuteGroupMemberReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message MuteGroupMemberResp{
|
message MuteGroupMemberResp{
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ message CancelMuteGroupMemberReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CancelMuteGroupMemberResp{
|
message CancelMuteGroupMemberResp{
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ message MuteGroupReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message MuteGroupResp{
|
message MuteGroupResp{
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ message CancelMuteGroupReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message CancelMuteGroupResp{
|
message CancelMuteGroupResp{
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ message SetGroupMemberNicknameReq{
|
|||||||
string userID = 5;
|
string userID = 5;
|
||||||
}
|
}
|
||||||
message SetGroupMemberNicknameResp{
|
message SetGroupMemberNicknameResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetJoinedSuperGroupListReq {
|
message GetJoinedSuperGroupListReq {
|
||||||
@ -333,7 +333,7 @@ message GetJoinedSuperGroupListReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetJoinedSuperGroupListResp {
|
message GetJoinedSuperGroupListResp {
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
repeated server_api_params.GroupInfo GroupList = 3;
|
repeated server_api_params.GroupInfo GroupList = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ message GetSuperGroupsInfoReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetSuperGroupsInfoResp {
|
message GetSuperGroupsInfoResp {
|
||||||
CommonResp commonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
repeated server_api_params.GroupInfo GroupInfoList = 3;
|
repeated server_api_params.GroupInfo GroupInfoList = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ message SetGroupMemberInfoReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message SetGroupMemberInfoResp{
|
message SetGroupMemberInfoResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupAbstractInfoReq{
|
message GetGroupAbstractInfoReq{
|
||||||
@ -370,7 +370,7 @@ message GetGroupAbstractInfoReq{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupAbstractInfoResp{
|
message GetGroupAbstractInfoResp{
|
||||||
CommonResp CommonResp = 1;
|
server_api_params.CommonResp commonResp = 1;
|
||||||
int32 groupMemberNumber = 2;
|
int32 groupMemberNumber = 2;
|
||||||
uint64 groupMemberListHash = 3;
|
uint64 groupMemberListHash = 3;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user