From 40c2390bac3c155455ac3319adb97c14108a7bb6 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Sun, 23 Apr 2023 16:24:11 +0800 Subject: [PATCH] update --- internal/logic/app/group_app.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/logic/app/group_app.go b/internal/logic/app/group_app.go index 2724244..534b371 100644 --- a/internal/logic/app/group_app.go +++ b/internal/logic/app/group_app.go @@ -188,11 +188,19 @@ func (*groupApp) DeleteMember(ctx context.Context, groupId int64, userId int64, // GetMembers 获取群组成员 func (*groupApp) GetMembers(ctx context.Context, groupId, limit int64) ([]*pb.GroupMember, error) { - group, err := repo.GroupRepo.GetLimit(groupId, limit) - if err != nil { - return nil, err + if limit == 0 { + group, err := repo.GroupRepo.Get(groupId) + if err != nil { + return nil, err + } + return group.GetMembers(ctx) + } else { + group, err := repo.GroupRepo.GetLimit(groupId, limit) + if err != nil { + return nil, err + } + return group.GetMembers(ctx) } - return group.GetMembers(ctx) } // SendMessage 发送群组消息