Browse Source

update

master
dengbiao 1 week ago
parent
commit
adb4847e51
2 changed files with 12 additions and 5 deletions
  1. +9
    -5
      internal/logic/api/logic_ext.go
  2. +3
    -0
      internal/logic/domain/group/repo/group_repo.go

+ 9
- 5
internal/logic/api/logic_ext.go View File

@@ -248,11 +248,15 @@ func (*LogicExtServer) GetGroup(ctx context.Context, in *pb.GetGroupReq) (*pb.Ge
return &pb.GetGroupResp{Group: group, MemberType: memberType, GroupUserStatusType: userStatusType}, err
}
groupNotice, err := repo.GroupRepo.GetGroupNotice(in.GroupId)
return &pb.GetGroupResp{Group: group, MemberType: memberType, GroupUserStatusType: userStatusType, GroupNotice: &pb.GroupNotice{
Content: groupNotice.Content,
PublishType: pb.GroupNoticePublishType(groupNotice.PublishType),
PublishTime: groupNotice.UpdateTime.Format("2006-01-02 15:04:05"),
}}, err
var groupNoticeInfo = pb.GroupNotice{}
if groupNotice == nil {
groupNoticeInfo = pb.GroupNotice{
Content: groupNotice.Content,
PublishType: pb.GroupNoticePublishType(groupNotice.PublishType),
PublishTime: groupNotice.UpdateTime.Format("2006-01-02 15:04:05"),
}
}
return &pb.GetGroupResp{Group: group, MemberType: memberType, GroupUserStatusType: userStatusType, GroupNotice: &groupNoticeInfo}, err
}

// GetGroups 获取用户加入的所有群组


+ 3
- 0
internal/logic/domain/group/repo/group_repo.go View File

@@ -56,6 +56,9 @@ func (*groupRepo) GetGroupNotice(groupId int64) (*model.GroupNotice, error) {
if err != nil {
return nil, err
}
if group == nil {
return nil, nil
}
err = GroupNoticeCache.Set(group)
if err != nil {
return nil, err


Loading…
Cancel
Save