Refactor code

pull/131/head
wenxu12345 3 years ago
parent 42c898d5aa
commit 6692867db5

@ -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
}

@ -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

Loading…
Cancel
Save