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.

update question pin show

aichy126766bf793c464
diff --git a/internal/schema/question_schema.go b/internal/schema/question_schema.go
index b5b523e8..9284ba9c 100644
--- a/internal/schema/question_schema.go
+++ b/internal/schema/question_schema.go
@@ -184,6 +184,8 @@ type QuestionInfo struct {
UpdateTime int64 `json:"-"` // update_time
PostUpdateTime int64 `json:"update_time"`
QuestionUpdateTime int64 `json:"edit_time"`
+ Pin int `json:"pin"` // 1: unpin, 2: pin
+ Show int `json:"show"` // 0: show, 1: hide
Status int `json:"status"`
Operation *Operation `json:"operation,omitempty"`
UserID string `json:"-" `
diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go
index 4b4f259b..38ae8a9d 100644
--- a/internal/service/question_common/question.go
+++ b/internal/service/question_common/question.go
@@ -528,6 +528,8 @@ func (qs *QuestionCommon) ShowFormat(ctx context.Context, data *entity.Question)
info.QuestionUpdateTime = 0
}
info.Status = data.Status
+ info.Pin = data.Pin
+ info.Show = data.Show
info.UserID = data.UserID
info.LastEditUserID = data.LastEditUserID
if data.LastAnswerID != "0" {