🎨 优化代码

master
linhaojun 3 years ago
parent 64ea0e3ae8
commit facea77b12

@ -73,7 +73,9 @@ public class TalkServiceImpl extends ServiceImpl<TalkMapper, Talk> implements Ta
talkDTO.setImgs(CommonUtil.castList(JSON.parseObject(talkDTO.getImages(), List.class), String.class));
}
CommentCountDTO commentCountDTO = commentMapper.listCommentCountByTypeAndTopicId(CommentTypeEnum.TALK.getType(), talkId);
talkDTO.setCommentCount(commentCountDTO.getCommentCount());
if (Objects.nonNull(commentCountDTO)) {
talkDTO.setCommentCount(commentCountDTO.getCommentCount());
}
return talkDTO;
}

Loading…
Cancel
Save