From 6692867db5053fff59e5b7e23adec1095ee8cc7a Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Thu, 30 Dec 2021 10:49:09 +0800 Subject: [PATCH] Refactor code --- internal/rpc/group/group.go | 4 ++-- .../db/mysql_model/im_mysql_model/group_request_model.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index 891b9efe0..7522b4f41 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -390,9 +390,9 @@ func (s *groupServer) GetGroupMembersInfo(ctx context.Context, req *pbGroup.GetG func (s *groupServer) GetGroupApplicationList(_ context.Context, req *pbGroup.GetGroupApplicationListReq) (*pbGroup.GetGroupApplicationListResp, error) { log.NewInfo(req.OperationID, "GetGroupMembersInfo args ", req.String()) - reply, err := im_mysql_model.GetGroupApplicationList(req.OpUserID) + reply, err := im_mysql_model.GetGroupApplicationList(req.FromUserID) if err != nil { - log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.OpUserID) + log.NewError(req.OperationID, "GetGroupApplicationList failed ", err.Error(), req.FromUserID) return &pbGroup.GetGroupApplicationListResp{ErrCode: 701, ErrMsg: "GetGroupApplicationList failed"}, nil } diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go index e90c2cdd5..8073c1cff 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_request_model.go @@ -4,6 +4,7 @@ import ( "Open_IM/pkg/common/constant" "Open_IM/pkg/common/db" "Open_IM/pkg/utils" + "fmt" "time" ) @@ -104,9 +105,12 @@ func GetGroupApplicationList(userID string) ([]GroupRequest, error) { if v.RoleLevel > constant.GroupOrdinaryUsers { list, err := GetGroupRequestByGroupID(v.GroupID) if err != nil { + fmt.Println("111 GetGroupRequestByGroupID failed ", err.Error()) continue } + fmt.Println("222 GetGroupRequestByGroupID ok ", list) groupRequestList = append(groupRequestList, list...) + fmt.Println("333 GetGroupRequestByGroupID ok ", groupRequestList) } } return groupRequestList, nil