feat(content): 标签增加语义码并随卡片下发
backend-ci / test (push) Canceled after 0s

标签名称会随语言和运营文案变化,客户端按名称判断板块(如推荐页「上新」
横滑)一改名就失效。content_tag 新增 code 列并在后台维护,
卡片与详情以 tagCode 下发,已有「上新 / 热剧 / 新剧 / 热播」一并回填。
This commit is contained in:
jianghaifeng authored and trae-solo-agent committed 2026-10-29 15:45:34 +08:00
1 parent 4d796089a0
commit 0d4d510aee
9 files changed
+73

No files matched your search

@@ -411,6 +411,7 @@ public class AppCatalogService {
ContentTag tag = tagOf(drama, tags);
Map<String, String> locales = tagLocales(tag);
card.setTagLocales(locales);
card.setTagCode(tagCode(tag));
card.setTagColor(tag == null ? "" : tag.getBgColor());
}
@@ -418,9 +419,18 @@ public class AppCatalogService {
ContentTag tag = tagOf(drama, loadTags(List.of(drama)));
Map<String, String> locales = tagLocales(tag);
detail.setTagLocales(locales);
detail.setTagCode(tagCode(tag));
detail.setTagColor(tag == null ? "" : tag.getBgColor());
}
/** 语义码直接下发,客户端据此判断板块;未配置时给空串,由客户端按文案兜底。 */
private String tagCode(ContentTag tag) {
if (tag == null || tag.getCode() == null) {
return "";
}
return tag.getCode().trim();
}
private ContentTag tagOf(Drama drama, Map<Long, ContentTag> tags) {
if (drama.getTagId() == null || drama.getTagId() <= 0L) {
return null;
@@ -20,6 +20,8 @@ public class AppDramaCardVO {
private List<Map<String, String>> types;
/** 标签语言表,key 为 zh / en / id。 */
private Map<String, String> tagLocales;
/** 标签语义码,如 NEW_ARRIVAL;客户端按码判断板块,文案仅用于展示。 */
private String tagCode;
/** 标签角标背景色,#RRGGBB。 */
private String tagColor;
private Integer totalEpisodes;
@@ -16,6 +16,8 @@ public class AppDramaDetailVO {
private String cover;
private List<Map<String, String>> types;
private Map<String, String> tagLocales;
/** 标签语义码,如 NEW_ARRIVAL;空表示未配置。 */
private String tagCode;
private String tagColor;
private Integer totalEpisodes;
private Integer freeEpisodes;