作者 tangxvhui

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

... ... @@ -61,12 +61,12 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr
Height: val2.Height,
})
}
resp.List[i] = types.MiniArticleBackupItem{
item := types.MiniArticleBackupItem{
Id: backupList[i].Id,
Title: backupList[i].Title,
Content: content.String(),
Images: images,
Videos: videos,
Title: "",
Content: "",
Images: []string{},
Videos: []types.Video{},
CreatedAt: backupList[i].CreatedAt,
Location: types.Location{
Longitude: backupList[i].Location.Longitude,
... ... @@ -77,6 +77,23 @@ func (l *MiniArticleBackupSearchLogic) MiniArticleBackupSearch(req *types.MiniAr
Action: backupList[i].Action,
Show: int(backupList[i].Show),
}
//根据修改的内容替换展示内容
changeFiled := []string{}
for _, val := range item.ChangeField {
switch val {
case "WhoRead":
changeFiled = append(changeFiled, "修改了分发对象")
case "WhoReview":
changeFiled = append(changeFiled, "修改了评论范围")
case "Section":
item.Title = backupList[i].Title
item.Content = content.String()
item.Images = images
item.Videos = videos
}
}
item.ChangeField = changeFiled
}
return resp, nil
}
... ...
... ... @@ -181,15 +181,7 @@ func (l *MiniCreateArticleCommentLogic) MiniCreateArticleComment(req *types.Mini
return err
}
}
//增加评论回复计数
// if pComment != nil {
// err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, pComment.Id)
// if err != nil {
// return err
// }
// }
// 增加最顶层的评论回复计数
// if newComment.TopId != 0 && newComment.Pid != newComment.TopId {
if newComment.TopId != 0 {
err = l.svcCtx.ArticleCommentRepository.IncreaseCountReply(l.ctx, c, 1, newComment.TopId)
if err != nil {
... ...