feat(playback): 观看记录返回标题多语言
This commit is contained in:
1 parent
e60c47123c
commit
ebc5f890fd
2 files changed
+9
-2
No files matched your search
+5
-1
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fruitshorts.common.pojo.PageResult;
|
||||
import com.fruitshorts.content.dal.entity.Drama;
|
||||
import com.fruitshorts.content.dal.entity.DramaEpisode;
|
||||
import com.fruitshorts.content.service.ContentLocaleTexts;
|
||||
import com.fruitshorts.content.service.DramaService;
|
||||
import com.fruitshorts.content.service.EpisodeService;
|
||||
import com.fruitshorts.playback.dal.entity.WatchHistory;
|
||||
@@ -218,7 +219,10 @@ public class WatchProgressService {
|
||||
ProgressRespVO vo = toResp(progress);
|
||||
Drama drama = dramaById.get(progress.getDramaId());
|
||||
if (drama != null) {
|
||||
vo.setDramaTitle(drama.getTitle());
|
||||
Map<String, String> titles = ContentLocaleTexts.read(
|
||||
drama.getTitleLocales(), drama.getTitle(), null, null);
|
||||
vo.setTitleLocales(titles);
|
||||
vo.setDramaTitle(ContentLocaleTexts.value(titles, ContentLocaleTexts.ZH));
|
||||
vo.setDramaCover(drama.getCoverUrl());
|
||||
vo.setTotalEpisodes(drama.getTotalEpisodes());
|
||||
vo.setViewCount(drama.getViewCount());
|
||||
|
||||
+4
-1
@@ -5,6 +5,7 @@ package com.fruitshorts.playback.vo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/** 续看进度。 */
|
||||
@Data
|
||||
@@ -12,8 +13,10 @@ public class ProgressRespVO {
|
||||
|
||||
private Long dramaId;
|
||||
private Long episodeId;
|
||||
/** 短剧标题,仅列表类接口批量装配。 */
|
||||
/** 短剧标题,仅列表类接口批量装配,取中文,兼容旧客户端。 */
|
||||
private String dramaTitle;
|
||||
/** 短剧标题语言表,key 为 zh / en / id。 */
|
||||
private Map<String, String> titleLocales;
|
||||
/** 短剧封面,仅列表类接口批量装配。 */
|
||||
private String dramaCover;
|
||||
/** 当前续看集号。 */
|
||||
|
||||
Reference in new issue
Block a user