This commit is contained in:
toom1996
2026-09-16 00:56:15 +08:00
parent 5e4803b97f
commit 7dd3fda73c
10 changed files with 184 additions and 54 deletions

View File

@ -51,8 +51,8 @@ func (s *indexService) Runway(ctx context.Context, locale string) (IndexRunwayDa
brands := make([]dto.PopularBrand, 0, len(rows))
for _, b := range rows {
brands = append(brands, dto.PopularBrand{
UID: hashid.Encode(b.ID),
ArticleUID: hashid.Encode(b.ArticleID),
UID: hashid.Encode(b.ID), // 品牌无类型,继续用全局编码(brand handler 用 Decode 解码)
ArticleUID: hashid.EncodeWithType(b.ArticleID, hashid.TypeRunway), // 走秀详情链接用类型化编码
// 品牌名强制优先英文("en"),不随 locale 切换,保持英文观感。
Brand: pickLocale(b.BrandEn, b.BrandCn, "en"),
Cover: s.img.Compose(b.Cover), // 首页热门卡片为大图展示,用高清样式(high)