diff --git a/internal/service/answer_common/answer.go b/internal/service/answer_common/answer.go index ef611351..196d6628 100644 --- a/internal/service/answer_common/answer.go +++ b/internal/service/answer_common/answer.go @@ -5,6 +5,7 @@ import ( "github.com/answerdev/answer/internal/entity" "github.com/answerdev/answer/internal/schema" + "github.com/answerdev/answer/pkg/htmltext" ) type AnswerRepo interface { @@ -75,11 +76,11 @@ func (as *AnswerCommon) AdminShowFormat(ctx context.Context, data *entity.Answer info := schema.AdminAnswerInfo{} info.ID = data.ID info.QuestionID = data.QuestionID - info.Description = data.ParsedText info.Adopted = data.Adopted info.VoteCount = data.VoteCount info.CreateTime = data.CreatedAt.Unix() info.UpdateTime = data.UpdatedAt.Unix() info.UserID = data.UserID + info.Description = htmltext.FetchExcerpt(data.ParsedText, "...", 240) return &info }