feat(posts): add post reference/internal linking functionality
Add support for referencing other posts within messages through a new post_ref segment type. Includes new PostReference model to track relationships, PostRefService for processing references, and new endpoints for post suggestions, related posts, and reference click tracking.
This commit is contained in:
@@ -250,8 +250,9 @@ const (
|
||||
SegmentTypeAt SegmentType = "at"
|
||||
SegmentTypeReply SegmentType = "reply"
|
||||
SegmentTypeFace SegmentType = "face"
|
||||
SegmentTypeLink SegmentType = "link"
|
||||
SegmentTypeVote SegmentType = "vote"
|
||||
SegmentTypeLink SegmentType = "link"
|
||||
SegmentTypeVote SegmentType = "vote"
|
||||
SegmentTypePostRef SegmentType = "post_ref"
|
||||
)
|
||||
|
||||
// TextSegmentData 文本数据
|
||||
@@ -325,6 +326,23 @@ type VoteOptionData struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
// PostRefSegmentData 帖子内链Segment数据
|
||||
type PostRefSegmentData struct {
|
||||
PostID string `json:"post_id"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Author *UserResponse `json:"author,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Accessible bool `json:"accessible"`
|
||||
ClickCount int `json:"click_count,omitzero"`
|
||||
}
|
||||
|
||||
// PostRefBrief 帖子内链简要信息 (用于搜索联想)
|
||||
type PostRefBrief struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Channel string `json:"channel,omitempty"`
|
||||
}
|
||||
|
||||
// VoteSegmentData 投票Segment数据
|
||||
type VoteSegmentData struct {
|
||||
Options []VoteOptionData `json:"options"`
|
||||
|
||||
Reference in New Issue
Block a user