瀏覽代碼

update

master
DengBiao 1 年之前
父節點
當前提交
49e7f9ff86
共有 2 個檔案被更改,包括 10 行新增22 行删除
  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 查看文件

@@ -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 查看文件

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



Loading…
取消
儲存