...
|
...
|
@@ -46,7 +46,7 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
queryOption = domain.NewQueryOptions().WithFindOnly().
|
|
|
MustWithKV("articleId", commentInfo.ArticleId).
|
|
|
MustWithKV("userId", req.UserId)
|
|
|
//TODO 获取我点赞的评论
|
|
|
// 获取我点赞的评论
|
|
|
_, userFlagList, err := l.svcCtx.UserLoveFlagRepository.Find(l.ctx, conn, queryOption)
|
|
|
if err != nil {
|
|
|
return nil, xerr.NewErrMsgErr("获取评论信息失败", err)
|
...
|
...
|
@@ -83,7 +83,7 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
CountReply: commentInfo.CountReply,
|
|
|
CountUserLove: commentInfo.CountUserLove,
|
|
|
CountAdminLove: commentInfo.CountAdminLove,
|
|
|
AtWho: []types.CommentAuthor{},
|
|
|
AtWho: []types.CommentAtWho{},
|
|
|
CreatedAt: commentInfo.CreatedAt,
|
|
|
MeLoveFlag: 0,
|
|
|
}
|
...
|
...
|
@@ -91,12 +91,9 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
commentResp.MeLoveFlag = 1
|
|
|
}
|
|
|
for _, val := range commentInfo.AtWho {
|
|
|
commentResp.AtWho = append(commentResp.AtWho, types.CommentAuthor{
|
|
|
commentResp.AtWho = append(commentResp.AtWho, types.CommentAtWho{
|
|
|
Id: val.Id,
|
|
|
Name: val.Name,
|
|
|
Avatar: val.Avatar,
|
|
|
Position: val.Position,
|
|
|
Company: val.Company,
|
|
|
})
|
|
|
}
|
|
|
allReply := []types.ArticleCommentItem{}
|
...
|
...
|
@@ -106,7 +103,7 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
Pid: val.Pid,
|
|
|
TopId: val.TopId,
|
|
|
ArtitcleId: val.ArticleId,
|
|
|
SectionId: val.ArticleId,
|
|
|
SectionId: val.SectionId,
|
|
|
FromUserId: val.FromUserId,
|
|
|
FromUser: types.CommentAuthor{
|
|
|
Id: val.FromUser.Id,
|
...
|
...
|
@@ -127,7 +124,7 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
CountReply: val.CountReply,
|
|
|
CountUserLove: val.CountUserLove,
|
|
|
CountAdminLove: val.CountAdminLove,
|
|
|
AtWho: []types.CommentAuthor{},
|
|
|
AtWho: []types.CommentAtWho{},
|
|
|
CreatedAt: val.CreatedAt,
|
|
|
MeLoveFlag: 0,
|
|
|
}
|
...
|
...
|
@@ -135,14 +132,12 @@ func (l *MiniGetArticleCommentLogic) MiniGetArticleComment(req *types.MiniGetArt |
|
|
reply.MeLoveFlag = 1
|
|
|
}
|
|
|
for _, val2 := range val.AtWho {
|
|
|
reply.AtWho = append(reply.AtWho, types.CommentAuthor{
|
|
|
reply.AtWho = append(reply.AtWho, types.CommentAtWho{
|
|
|
Id: val2.Id,
|
|
|
Name: val2.Name,
|
|
|
Avatar: val2.Avatar,
|
|
|
Position: val2.Position,
|
|
|
Company: val2.Company,
|
|
|
})
|
|
|
}
|
|
|
allReply = append(allReply, reply)
|
|
|
}
|
|
|
resp = &types.MiniGetArticleCommentResponse{
|
|
|
ArticleCommentAndReply: types.ArticleCommentAndReply{
|
...
|
...
|
|