Browse Source

update

master
DengBiao 1 year ago
parent
commit
49e7f9ff86
2 changed files with 10 additions and 22 deletions
  1. +9
    -8
      internal/logic/domain/group/model/group.go
  2. +1
    -14
      internal/logic/domain/group/repo/group_repo.go

+ 9
- 8
internal/logic/domain/group/model/group.go View File

@@ -55,14 +55,15 @@ func (g *Group) ToProto() *pb.Group {
} }


return &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(),
} }
} }




+ 1
- 14
internal/logic/domain/group/repo/group_repo.go View File

@@ -37,15 +37,7 @@ func (*groupRepo) Get(groupId int64) (*model.Group, error) {


// GetForBanned 获取群组禁言用户信息 // GetForBanned 获取群组禁言用户信息
func (*groupRepo) GetForBanned(groupId int64) (*model.Group, error) { 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 { if err != nil {
return nil, err return nil, err
} }
@@ -54,11 +46,6 @@ func (*groupRepo) GetForBanned(groupId int64) (*model.Group, error) {
return nil, err return nil, err
} }
group.Members = members group.Members = members

err = GroupCache.Set(group)
if err != nil {
return nil, err
}
return group, nil return group, nil
} }




Loading…
Cancel
Save