update
This commit is contained in:
@ -51,7 +51,9 @@ func (s *articleService) List(ctx context.Context, q dto.ArticleQuery) ([]dto.Pu
|
||||
Title: pickLocale(r.TitleEn, r.TitleCn, q.Locale),
|
||||
Summary: textutil.Summarize(pickLocale(r.DescriptionEn, r.DescriptionCn, q.Locale), summaryLength),
|
||||
Cover: r.Cover,
|
||||
BrandName: pickLocale(r.BrandNameEn, r.BrandNameCn, q.Locale),
|
||||
// 品牌名强制优先英文("en"),仅在英文缺失时回落中文,避免留空;
|
||||
// 与 title/description 不同,品牌名不随 locale 切换,保持英文观感。
|
||||
BrandName: pickLocale(r.BrandNameEn, r.BrandNameCn, "en"),
|
||||
Year: r.Year,
|
||||
ImageCount: r.ImageCount,
|
||||
CollectionType: r.CollectionType,
|
||||
@ -111,7 +113,8 @@ func (s *articleService) Detail(ctx context.Context, id string, locale string) (
|
||||
Summary: textutil.Summarize(pickLocale(row.DescriptionEn, row.DescriptionCn, locale), summaryLength),
|
||||
Description: pickLocale(row.DescriptionEn, row.DescriptionCn, locale),
|
||||
Cover: row.Cover,
|
||||
BrandName: pickLocale(row.BrandNameEn, row.BrandNameCn, locale),
|
||||
// 品牌名强制优先英文("en"),不随 locale 切换,保持英文观感。
|
||||
BrandName: pickLocale(row.BrandNameEn, row.BrandNameCn, "en"),
|
||||
Year: row.Year,
|
||||
ImageCount: row.ImageCount,
|
||||
SourceURL: row.SourceURL,
|
||||
|
||||
Reference in New Issue
Block a user