feat: enrich content item fields

This commit is contained in:
2026-01-08 11:30:31 +08:00
parent 054a4f414a
commit ce95865f92
3 changed files with 39 additions and 14 deletions

View File

@@ -13,20 +13,31 @@ type ContentListFilter struct {
}
type ContentItem struct {
ID int64 `json:"id"`
Title string `json:"title"`
Cover string `json:"cover"`
Genre string `json:"genre"`
Type string `json:"type"` // video, audio, article
Price float64 `json:"price"`
AuthorID int64 `json:"author_id"`
AuthorName string `json:"author_name"`
AuthorAvatar string `json:"author_avatar"`
AuthorIsFollowing bool `json:"author_is_following"`
Views int `json:"views"`
Likes int `json:"likes"`
CreatedAt string `json:"created_at"`
IsPurchased bool `json:"is_purchased"`
ID int64 `json:"id"`
// TenantID 内容所属租户ID。
TenantID int64 `json:"tenant_id"`
// UserID 内容作者用户ID与 author_id 同义,便于后台展示)。
UserID int64 `json:"user_id"`
Title string `json:"title"`
Cover string `json:"cover"`
Genre string `json:"genre"`
Type string `json:"type"` // video, audio, article
// Status 内容状态(如 published/unpublished
Status string `json:"status"`
// Visibility 内容可见性(如 public/tenant_only/private
Visibility string `json:"visibility"`
Price float64 `json:"price"`
AuthorID int64 `json:"author_id"`
AuthorName string `json:"author_name"`
// AuthorAvatar 作者头像URL。
AuthorAvatar string `json:"author_avatar"`
AuthorIsFollowing bool `json:"author_is_following"`
Views int `json:"views"`
Likes int `json:"likes"`
CreatedAt string `json:"created_at"`
// PublishedAt 发布时间,未发布为空。
PublishedAt string `json:"published_at"`
IsPurchased bool `json:"is_purchased"`
}
type ContentDetail struct {