Browse Source

update 返回缩略图

master
dengbiao 5 months ago
parent
commit
a4df848683
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      internal/logic/domain/group/model/group.go

+ 12
- 0
internal/logic/domain/group/model/group.go View File

@@ -12,6 +12,7 @@ import (
"gim/pkg/pb" "gim/pkg/pb"
"gim/pkg/rpc" "gim/pkg/rpc"
"gim/pkg/util" "gim/pkg/util"
"strings"
"time" "time"


"go.uber.org/zap" "go.uber.org/zap"
@@ -374,6 +375,17 @@ func (g *Group) GetMembers(ctx context.Context) ([]*pb.GroupMember, error) {
member.AvatarUrl = user.AvatarUrl member.AvatarUrl = user.AvatarUrl
member.UserExtra = user.Extra member.UserExtra = user.Extra
} }

//TODO::返回缩略图
// 检查URL中是否已存在'?'
if strings.Contains(member.AvatarUrl, "?") {
// 如果存在'?',则分割URL和查询参数,并替换查询参数
parts := strings.Split(member.AvatarUrl, "?")
member.AvatarUrl = parts[0] + "?imageView2/1/w/200/h/200"
} else {
// 如果不存在'?',则直接添加新的查询参数
member.AvatarUrl += "?imageView2/1/w/200/h/200"
}
infos[i] = &member infos[i] = &member
} }




Loading…
Cancel
Save