From 49e7f9ff863f1484cdb95282695f8b2e15c4e792 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Thu, 6 Apr 2023 11:59:58 +0800 Subject: [PATCH] update --- internal/logic/domain/group/model/group.go | 17 +++++++++-------- internal/logic/domain/group/repo/group_repo.go | 15 +-------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/internal/logic/domain/group/model/group.go b/internal/logic/domain/group/model/group.go index 9596002..3dd68b4 100644 --- a/internal/logic/domain/group/model/group.go +++ b/internal/logic/domain/group/model/group.go @@ -55,14 +55,15 @@ func (g *Group) ToProto() *pb.Group { } return &pb.Group{ - GroupId: g.Id, - Name: g.Name, - AvatarUrl: g.AvatarUrl, - Introduction: g.Introduction, - UserMum: g.UserNum, - Extra: g.Extra, - CreateTime: g.CreateTime.Unix(), - UpdateTime: g.UpdateTime.Unix(), + GroupId: g.Id, + Name: g.Name, + AvatarUrl: g.AvatarUrl, + Introduction: g.Introduction, + UserMum: g.UserNum, + IsAllMemberBanned: g.IsAllMemberBanned, + Extra: g.Extra, + CreateTime: g.CreateTime.Unix(), + UpdateTime: g.UpdateTime.Unix(), } } diff --git a/internal/logic/domain/group/repo/group_repo.go b/internal/logic/domain/group/repo/group_repo.go index 32b363e..7182649 100644 --- a/internal/logic/domain/group/repo/group_repo.go +++ b/internal/logic/domain/group/repo/group_repo.go @@ -37,15 +37,7 @@ func (*groupRepo) Get(groupId int64) (*model.Group, error) { // GetForBanned 获取群组禁言用户信息 func (*groupRepo) GetForBanned(groupId int64) (*model.Group, error) { - group, err := GroupCache.Get(groupId) - if err != nil { - return nil, err - } - if group != nil { - return group, nil - } - - group, err = GroupDao.Get(groupId) + group, err := GroupDao.Get(groupId) if err != nil { return nil, err } @@ -54,11 +46,6 @@ func (*groupRepo) GetForBanned(groupId int64) (*model.Group, error) { return nil, err } group.Members = members - - err = GroupCache.Set(group) - if err != nil { - return nil, err - } return group, nil }