作者 郑周

1 评论结构 替换

@@ -48,7 +48,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res @@ -48,7 +48,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res
48 var companyIdMap = map[int64]*domain.Company{} 48 var companyIdMap = map[int64]*domain.Company{}
49 var userIdMap = map[int64]*domain.User{} 49 var userIdMap = map[int64]*domain.User{}
50 var articleIdMap = map[int64]*domain.Article{} 50 var articleIdMap = map[int64]*domain.Article{}
51 - var commentIdMap = map[int64]*domain.Comment{} 51 + var commentIdMap = map[int64]*domain.ArticleComment{}
52 //var discussionIdMap = map[int64]int{} 52 //var discussionIdMap = map[int64]int{}
53 //var discussionOpinionIdMap = map[int64]int{} 53 //var discussionOpinionIdMap = map[int64]int{}
54 for _, item := range list { 54 for _, item := range list {
@@ -126,7 +126,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res @@ -126,7 +126,7 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res
126 126
127 // 获取评论 127 // 获取评论
128 if len(commentIds) > 0 { 128 if len(commentIds) > 0 {
129 - _, commentList, err := l.svcCtx.CommentRepository.Find(l.ctx, conn, domain.NewQueryOptions(). 129 + _, commentList, err := l.svcCtx.ArticleCommentRepository.Find(l.ctx, conn, domain.NewQueryOptions().
130 WithFindOnly(). 130 WithFindOnly().
131 WithKV("ids", commentIds). 131 WithKV("ids", commentIds).
132 WithKV("limit", len(commentIds))) 132 WithKV("limit", len(commentIds)))
@@ -192,12 +192,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res @@ -192,12 +192,12 @@ func (l *MiniBusinessLogic) MiniBusiness(req *types.MessageBusinessRequest) (res
192 } 192 }
193 } 193 }
194 194
195 - if _, ok := commentIdMap[item.CommentId]; ok { 195 + if v, ok := commentIdMap[item.CommentId]; ok {
196 to.Comment = &types.SimpleComment{ 196 to.Comment = &types.SimpleComment{
197 - //Id: v.Id,  
198 - //Title: v.Title,  
199 - //CountLove: v.CountLove,  
200 - //CountComment: v.CountComment, 197 + Id: v.Id,
  198 + Content: v.Content,
  199 + CountLove: v.CountUserLove,
  200 + CountComment: v.CountReply,
201 } 201 }
202 } 202 }
203 203