Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix question update time

aichy12659d4349a3974
diff --git a/internal/service/question_service.go b/internal/service/question_service.go
index 1c929ece..7dd3ad9f 100644
--- a/internal/service/question_service.go
+++ b/internal/service/question_service.go
@@ -295,6 +295,7 @@ func (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.Quest
question.ParsedText = req.HTML
question.ID = req.ID
question.UpdatedAt = now
+ question.PostUpdateTime = now
dbinfo, has, err := qs.questionRepo.GetQuestion(ctx, question.ID)
if err != nil {
return
@@ -381,7 +382,7 @@ func (qs *QuestionService) UpdateQuestion(ctx context.Context, req *schema.Quest
//Direct modification
revisionDTO.Status = entity.RevisionReviewPassStatus
//update question to db
- saveerr := qs.questionRepo.UpdateQuestion(ctx, question, []string{"title", "original_text", "parsed_text", "updated_at"})
+ saveerr := qs.questionRepo.UpdateQuestion(ctx, question, []string{"title", "original_text", "parsed_text", "updated_at", "post_update_time"})
if saveerr != nil {
return questionInfo, saveerr
}
diff --git a/internal/service/revision_service.go b/internal/service/revision_service.go
index bfe28508..20fb14ba 100644
--- a/internal/service/revision_service.go
+++ b/internal/service/revision_service.go
@@ -127,7 +127,8 @@ func (rs *RevisionService) revisionAuditQuestion(ctx context.Context, revisionit
question.OriginalText = questioninfo.Content
question.ParsedText = questioninfo.HTML
question.UpdatedAt = now
- saveerr := rs.questionRepo.UpdateQuestion(ctx, question, []string{"title", "original_text", "parsed_text", "updated_at"})
+ question.PostUpdateTime = now
+ saveerr := rs.questionRepo.UpdateQuestion(ctx, question, []string{"title", "original_text", "parsed_text", "updated_at", "post_update_time"})
if saveerr != nil {
return saveerr
}