DengBiao 1 anno fa
parent
commit
49e7f9ff86
2 ha cambiato i file con 10 aggiunte e 22 eliminazioni
  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 Vedi File

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



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

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



Caricamento…
Annulla
Salva