|
|
|
@ -885,8 +885,7 @@ func CheckPermission(ctx context.Context, groupID string, userID string) error {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup.GroupApplicationResponseReq) (*pbGroup.GroupApplicationResponseResp, error) {
|
|
|
|
|
ctx = trace_log.NewRpcCtx(ctx, utils.GetSelfFuncName(), req.OperationID)
|
|
|
|
|
trace_log.SetRpcReqInfo(ctx, utils.GetSelfFuncName(), req.String())
|
|
|
|
|
trace_log.SetRpcReqInfo(trace_log.NewRpcCtx(ctx, utils.GetSelfFuncName(), req.OperationID), utils.GetSelfFuncName(), req.String())
|
|
|
|
|
defer trace_log.ShowLog(ctx)
|
|
|
|
|
resp := pbGroup.GroupApplicationResponseResp{CommonResp: &pbGroup.CommonResp{}}
|
|
|
|
|
if err := CheckPermission(ctx, req.GroupID, req.OpUserID); err != nil {
|
|
|
|
@ -944,7 +943,7 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
|
|
|
|
|
},
|
|
|
|
|
}, nil
|
|
|
|
|
}
|
|
|
|
|
err = (&imdb.GroupMember{}).Create(nCtx, []*imdb.GroupMember{&member})
|
|
|
|
|
err = (&imdb.GroupMember{}).Create(ctx, []*imdb.GroupMember{&member})
|
|
|
|
|
if err != nil {
|
|
|
|
|
SetErrorForResp(err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
|
|
|
|
return &resp, nil
|
|
|
|
@ -958,11 +957,11 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
|
|
|
|
|
cacheClient := pbCache.NewCacheClient(etcdCacheConn)
|
|
|
|
|
cacheResp, err := cacheClient.DelGroupMemberIDListFromCache(context.Background(), &pbCache.DelGroupMemberIDListFromCacheReq{OperationID: req.OperationID, GroupID: req.GroupID})
|
|
|
|
|
if err != nil {
|
|
|
|
|
SetErr(nCtx, "DelGroupMemberIDListFromCache", err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg, "groupID", req.GroupID)
|
|
|
|
|
SetErr(ctx, "DelGroupMemberIDListFromCache", err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg, "groupID", req.GroupID)
|
|
|
|
|
return &resp, nil
|
|
|
|
|
}
|
|
|
|
|
if cacheResp.CommonResp.ErrCode != 0 {
|
|
|
|
|
SetErrCodeMsg(nCtx, "DelGroupMemberIDListFromCache", cacheResp.CommonResp.ErrCode, cacheResp.CommonResp.ErrMsg, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
|
|
|
|
SetErrCodeMsg(ctx, "DelGroupMemberIDListFromCache", cacheResp.CommonResp.ErrCode, cacheResp.CommonResp.ErrMsg, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
|
|
|
|
return &resp, nil
|
|
|
|
|
}
|
|
|
|
|
if err := rocksCache.DelGroupMemberListHashFromCache(req.GroupID); err != nil {
|
|
|
|
@ -979,7 +978,7 @@ func (s *groupServer) GroupApplicationResponse(ctx context.Context, req *pbGroup
|
|
|
|
|
} else if req.HandleResult == constant.GroupResponseRefuse {
|
|
|
|
|
chat.GroupApplicationRejectedNotification(req)
|
|
|
|
|
} else {
|
|
|
|
|
SetErr(nCtx, "", constant.ErrArgs, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
|
|
|
|
SetErr(ctx, "", constant.ErrArgs, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg)
|
|
|
|
|
return &resp, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|