作者 tangxvhui

调整 编辑历史展示内容输出

@@ -61,12 +61,12 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr @@ -61,12 +61,12 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr
61 Height: val2.Height, 61 Height: val2.Height,
62 }) 62 })
63 } 63 }
64 - resp.List[i] = types.MiniArticleBackupItem{ 64 + item := types.MiniArticleBackupItem{
65 Id: backupList[i].Id, 65 Id: backupList[i].Id,
66 - Title: backupList[i].Title,  
67 - Content: content.String(),  
68 - Images: images,  
69 - Videos: videos, 66 + Title: "",
  67 + Content: "",
  68 + Images: []string{},
  69 + Videos: []types.Video{},
70 CreatedAt: backupList[i].CreatedAt, 70 CreatedAt: backupList[i].CreatedAt,
71 Location: types.Location{ 71 Location: types.Location{
72 Longitude: backupList[i].Location.Longitude, 72 Longitude: backupList[i].Location.Longitude,
@@ -77,6 +77,23 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr @@ -77,6 +77,23 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr
77 Action: backupList[i].Action, 77 Action: backupList[i].Action,
78 Show: int(backupList[i].Show), 78 Show: int(backupList[i].Show),
79 } 79 }
  80 + //根据修改的内容替换展示内容
  81 + changeFiled := []string{}
  82 + for _, val := range item.ChangeField {
  83 + switch val {
  84 + case "WhoRead":
  85 + changeFiled = append(changeFiled, "修改了分发对象")
  86 + case "WhoReview":
  87 + changeFiled = append(changeFiled, "修改了评论范围")
  88 + case "Section":
  89 + item.Title = backupList[i].Title
  90 + item.Content = content.String()
  91 + item.Images = images
  92 + item.Videos = videos
  93 + }
  94 + }
  95 + item.ChangeField = changeFiled
  96 +
80 } 97 }
81 return resp, nil 98 return resp, nil
82 } 99 }
@@ -181,15 +181,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini @@ -181,15 +181,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini
181 return err 181 return err
182 } 182 }
183 } 183 }
184 - //增加评论回复计数  
185 - // if pComment != nil {  
186 - // err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, pComment.Id)  
187 - // if err != nil {  
188 - // return err  
189 - // }  
190 - // }  
191 // 增加最顶层的评论回复计数 184 // 增加最顶层的评论回复计数
192 - // if newComment.TopId != 0 && newComment.Pid != newComment.TopId {  
193 if newComment.TopId != 0 { 185 if newComment.TopId != 0 {
194 err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, newComment.TopId) 186 err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, newComment.TopId)
195 if err != nil { 187 if err != nil {