groupCallback

test-errcode
wangchuxiao 2 years ago
parent 463f08546e
commit 90cc7937e6

@ -16,7 +16,7 @@ import (
func callbackBeforeCreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (err error) {
defer func() {
trace_log.SetContextInfo(ctx, utils.GetSelfFuncName(), err, "req", req)
trace_log.SetContextInfo(ctx, utils.GetFuncName(1), err, "req", req)
}()
if !config.Config.Callback.CallbackBeforeCreateGroup.Enable {
return nil
@ -79,7 +79,7 @@ func callbackBeforeCreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq)
func CallbackBeforeMemberJoinGroup(ctx context.Context, operationID string, groupMember *im_mysql_model.GroupMember, groupEx string) (err error) {
defer func() {
trace_log.SetContextInfo(ctx, "CallbackBeforeMemberJoinGroup", err, "groupMember", *groupMember, "groupEx", groupEx)
trace_log.SetContextInfo(ctx, utils.GetFuncName(1), err, "groupMember", *groupMember, "groupEx", groupEx)
}()
callbackResp := cbApi.CommonCallbackResp{OperationID: operationID}
if !config.Config.Callback.CallbackBeforeMemberJoinGroup.Enable {
@ -121,7 +121,7 @@ func CallbackBeforeMemberJoinGroup(ctx context.Context, operationID string, grou
func CallbackBeforeSetGroupMemberInfo(ctx context.Context, req *pbGroup.SetGroupMemberInfoReq) (err error) {
defer func() {
trace_log.SetContextInfo(ctx, "CallbackBeforeSetGroupMemberInfo", err, "req", *req)
trace_log.SetContextInfo(ctx, utils.GetFuncName(1), err, "req", *req)
}()
callbackResp := cbApi.CommonCallbackResp{OperationID: req.OperationID}
if !config.Config.Callback.CallbackBeforeSetGroupMemberInfo.Enable {

@ -212,13 +212,13 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
}
group, err := rocksCache.GetGroupInfoFromCache(ctx, groupId)
if err != nil {
SetErr(ctx, "GetGroupInfoFromCache", err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg, "groupID", groupId)
SetErrorForResp(err, resp.CommonResp)
return
}
utils.CopyStructFields(resp.GroupInfo, group)
memberCount, err := rocksCache.GetGroupMemberNumFromCache(groupId)
if err != nil {
SetErr(ctx, "GetGroupMemberNumFromCache", err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg, "groupID", groupId)
SetErrorForResp(err, resp.CommonResp)
return
}
resp.GroupInfo.MemberCount = uint32(memberCount)
@ -232,7 +232,7 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
okUserIDList = append(okUserIDList, v.UserID)
}
if err := db.DB.CreateSuperGroup(groupId, okUserIDList, len(okUserIDList)); err != nil {
SetErr(ctx, "CreateSuperGroup", err, &resp.CommonResp.ErrCode, &resp.CommonResp.ErrMsg, "groupID", groupId, "userIDList", okUserIDList)
SetErrorForResp(err, resp.CommonResp)
return
}
}

Loading…
Cancel
Save