feat(app-api): 详情补充互动数量字段
This commit is contained in:
1 parent
678652cb20
commit
671953bff3
7 files changed
+231
-1
No files matched your search
@@ -17,6 +17,7 @@ import com.fruitshorts.content.service.BannerService;
|
||||
import com.fruitshorts.content.service.DramaCategoryService;
|
||||
import com.fruitshorts.content.service.DramaService;
|
||||
import com.fruitshorts.content.service.EpisodeService;
|
||||
import com.fruitshorts.interaction.service.CommentService;
|
||||
import com.fruitshorts.media.service.PlaybackSigner;
|
||||
import com.fruitshorts.content.vo.DramaCategoryRespVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -44,6 +45,7 @@ public class AppCatalogService {
|
||||
private final BannerService bannerService;
|
||||
private final DramaCategoryService dramaCategoryService;
|
||||
private final PlaybackSigner playbackSigner;
|
||||
private final CommentService commentService;
|
||||
|
||||
public AppFeedVO homeFeed() {
|
||||
Map<Long, String> categoryNames = categoryNameMap();
|
||||
@@ -96,6 +98,9 @@ public class AppCatalogService {
|
||||
detail.setUnlockCoin(drama.getUnlockCoin());
|
||||
detail.setIsHot(drama.getIsHot() != null && drama.getIsHot() == 1);
|
||||
detail.setViewCount(drama.getViewCount());
|
||||
detail.setLikeCount(drama.getLikeCount());
|
||||
detail.setFavoriteCount(drama.getFavoriteCount());
|
||||
detail.setCommentCount(commentService.countByDrama(dramaId));
|
||||
detail.setEpisodes(episodes.stream().map(this::toEpisode).toList());
|
||||
return detail;
|
||||
}
|
||||
|
||||
@@ -20,5 +20,11 @@ public class AppDramaDetailVO {
|
||||
private Integer unlockCoin;
|
||||
private Boolean isHot;
|
||||
private Long viewCount;
|
||||
/** 短剧累计点赞数:drama.like_count */
|
||||
private Long likeCount;
|
||||
/** 短剧累计收藏数:drama.favorite_count */
|
||||
private Long favoriteCount;
|
||||
/** 该剧未删除评论数:content_comment 按 drama_id 统计 */
|
||||
private Long commentCount;
|
||||
private List<AppEpisodeVO> episodes;
|
||||
}
|
||||
Reference in new issue
Block a user