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.
add question and tags Description
aichy126d8682e726428
diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.goindex 65c66d51..25d20557 100644--- a/internal/schema/question_schema.go+++ b/internal/schema/question_schema.go@@ -97,6 +97,7 @@ type QuestionInfo struct {Title string `json:"title" xorm:"title"` // titleContent string `json:"content" xorm:"content"` // contentHTML string `json:"html" xorm:"html"` // html+ Description string `json:"description"` //descriptionTags []*TagResp `json:"tags" ` // tagsViewCount int `json:"view_count" xorm:"view_count"` // view_countUniqueViewCount int `json:"unique_view_count" xorm:"unique_view_count"` // unique_view_countdiff --git a/internal/schema/tag_schema.go b/internal/schema/tag_schema.goindex 796b6bb8..278b309d 100644--- a/internal/schema/tag_schema.go+++ b/internal/schema/tag_schema.go@@ -66,6 +66,8 @@ type GetTagResp struct {OriginalText string `json:"original_text"`// parsed textParsedText string `json:"parsed_text"`+ // description text+ Description string `json:"description"`// follower amountFollowCount int `json:"follow_count"`// question amountdiff --git a/internal/service/question_service.go b/internal/service/question_service.goindex cca6b9f2..ea46c533 100644--- a/internal/service/question_service.go+++ b/internal/service/question_service.go@@ -23,6 +23,7 @@ import ("github.com/answerdev/answer/internal/service/revision_common"tagcommon "github.com/answerdev/answer/internal/service/tag_common"usercommon "github.com/answerdev/answer/internal/service/user_common"+ "github.com/answerdev/answer/pkg/htmltext""github.com/jinzhu/copier""github.com/segmentfault/pacman/errors""github.com/segmentfault/pacman/i18n"@@ -454,6 +455,7 @@ func (qs *QuestionService) GetQuestion(ctx context.Context, questionID, userID sif question.Status == entity.QuestionStatusClosed {per.CanClose = false}+ question.Description = htmltext.FetchExcerpt(question.HTML, "...", 240)question.MemberActions = permission.GetQuestionPermission(ctx, userID, question.UserID,per.CanEdit, per.CanDelete, per.CanClose, per.CanReopen)return question, nildiff --git a/internal/service/tag/tag_service.go b/internal/service/tag/tag_service.goindex 1504f4fe..8ebe610c 100644--- a/internal/service/tag/tag_service.go+++ b/internal/service/tag/tag_service.go@@ -105,6 +105,7 @@ func (ts *TagService) GetTagInfo(ctx context.Context, req *schema.GetTagInfoReq)resp.DisplayName = tagInfo.DisplayNameresp.OriginalText = tagInfo.OriginalTextresp.ParsedText = tagInfo.ParsedText+ resp.Description = htmltext.FetchExcerpt(tagInfo.ParsedText, "...", 240)resp.FollowCount = tagInfo.FollowCountresp.QuestionCount = tagInfo.QuestionCountresp.Recommend = tagInfo.Recommend