feat(review): add url title for review page

This commit is contained in:
LinkinStars
2024-03-15 16:26:51 +08:00
parent 758f79b7dd
commit 34660ee161
4 changed files with 6 additions and 0 deletions
+1
View File
@@ -79,6 +79,7 @@ type GetReportListPageResp struct {
CommentID string `json:"comment_id"`
ObjectType string `json:"object_type" enums:"question,answer,comment"`
Title string `json:"title"`
UrlTitle string `json:"url_title"`
OriginalText string `json:"original_text"`
AnswerCount int `json:"answer_count"`
AnswerAccepted bool `json:"answer_accepted"`
+1
View File
@@ -48,6 +48,7 @@ type GetUnreviewedPostPageResp struct {
CommentID string `json:"comment_id"`
ObjectType string `json:"object_type" enums:"question,answer,comment"`
Title string `json:"title"`
UrlTitle string `json:"url_title"`
OriginalText string `json:"original_text"`
Tags []*TagResp `json:"tags"`
ObjectStatus int `json:"object_status"`
@@ -36,6 +36,7 @@ import (
"github.com/apache/incubator-answer/internal/service/report_common"
"github.com/apache/incubator-answer/internal/service/report_handle"
usercommon "github.com/apache/incubator-answer/internal/service/user_common"
"github.com/apache/incubator-answer/pkg/htmltext"
"github.com/apache/incubator-answer/pkg/obj"
"github.com/jinzhu/copier"
"github.com/segmentfault/pacman/errors"
@@ -136,6 +137,7 @@ func (rs *ReportService) GetUnreviewedReportPostPage(ctx context.Context, req *s
AnswerID: info.AnswerID,
CommentID: info.CommentID,
Title: info.Title,
UrlTitle: htmltext.UrlTitle(info.Title),
OriginalText: info.Content,
AnswerCount: info.AnswerCount,
AnswerAccepted: info.AnswerAccepted,
@@ -34,6 +34,7 @@ import (
"github.com/apache/incubator-answer/internal/service/role"
tagcommon "github.com/apache/incubator-answer/internal/service/tag_common"
usercommon "github.com/apache/incubator-answer/internal/service/user_common"
"github.com/apache/incubator-answer/pkg/htmltext"
"github.com/apache/incubator-answer/pkg/token"
"github.com/apache/incubator-answer/pkg/uid"
"github.com/apache/incubator-answer/plugin"
@@ -357,6 +358,7 @@ func (cs *ReviewService) GetUnreviewedPostPage(ctx context.Context, req *schema.
CommentID: info.CommentID,
ObjectType: info.ObjectType,
Title: info.Title,
UrlTitle: htmltext.UrlTitle(info.Title),
OriginalText: info.Content,
Tags: info.Tags,
ObjectStatus: info.Status,