feat(app-api): 详情补充互动数量字段
This commit is contained in:
1 parent
678652cb20
commit
671953bff3
7 files changed
+231
-1
No files matched your search
+16
@@ -169,6 +169,22 @@ public class CommentService {
|
||||
softDelete(comment);
|
||||
}
|
||||
|
||||
/**
|
||||
* 某部剧的评论总数(顶层评论与回复合计)。
|
||||
*
|
||||
* <p>只统计未删除评论:逻辑删除的记录由 MyBatis-Plus 自动过滤,
|
||||
* 用户删除后状态置为 deleted 的记录也要排除。
|
||||
*/
|
||||
public long countByDrama(Long dramaId) {
|
||||
if (dramaId == null) {
|
||||
return 0L;
|
||||
}
|
||||
Long count = commentMapper.selectCount(Wrappers.<ContentComment>lambdaQuery()
|
||||
.eq(ContentComment::getDramaId, dramaId)
|
||||
.ne(ContentComment::getStatus, STATUS_DELETED));
|
||||
return count == null ? 0L : count;
|
||||
}
|
||||
|
||||
// ---------------- 后台 ----------------
|
||||
|
||||
public PageResult<CommentRespVO> adminPage(CommentQueryReqVO req) {
|
||||
|
||||
Reference in new issue
Block a user