...
|
...
|
@@ -36,8 +36,8 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList |
|
|
if err != nil {
|
|
|
return nil, xerr.NewErrMsgErr("获取评论信息失败", err)
|
|
|
}
|
|
|
if req.Size > 40 {
|
|
|
req.Size = 40
|
|
|
if req.Size > 100 {
|
|
|
req.Size = 100
|
|
|
}
|
|
|
|
|
|
queryOption := domain.NewQueryOptions().
|
...
|
...
|
@@ -119,7 +119,7 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList |
|
|
}
|
|
|
|
|
|
//获取回复的评论
|
|
|
cntReply, reply := l.listCommentReply(item.Comment.Id, flagMap)
|
|
|
cntReply, reply := l.listCommentReply(companyInfo.Id, item.Comment.Id, flagMap)
|
|
|
resp.List[i] = item
|
|
|
resp.List[i].Reply = reply
|
|
|
resp.List[i].TotalReply = cntReply
|
...
|
...
|
@@ -128,9 +128,9 @@ func (l *MiniListArticleCommentLogic) MiniListArticleComment(req *types.MiniList |
|
|
}
|
|
|
|
|
|
// listCommentReply
|
|
|
func (l *MiniListArticleCommentLogic) listCommentReply(commentId int64, loveFlagMap map[int64]struct{}) (cnt int64, replyList []types.ArticleCommentItem) {
|
|
|
func (l *MiniListArticleCommentLogic) listCommentReply(companyId int64, commentId int64, loveFlagMap map[int64]struct{}) (cnt int64, replyList []types.ArticleCommentItem) {
|
|
|
var conn = l.svcCtx.DefaultDBConn()
|
|
|
companyInfo, err := l.svcCtx.CompanyRepository.FindOne(l.ctx, conn, commentId)
|
|
|
companyInfo, err := l.svcCtx.CompanyRepository.FindOne(l.ctx, conn, companyId)
|
|
|
if err != nil {
|
|
|
return 0, []types.ArticleCommentItem{}
|
|
|
}
|
...
|
...
|
|