chore: enrich content dto comments
This commit is contained in:
@@ -4,94 +4,147 @@ import "quyun/v2/app/requests"
|
|||||||
|
|
||||||
type ContentListFilter struct {
|
type ContentListFilter struct {
|
||||||
requests.Pagination
|
requests.Pagination
|
||||||
|
// Keyword 关键词搜索(匹配标题/摘要/描述)。
|
||||||
Keyword *string `query:"keyword"`
|
Keyword *string `query:"keyword"`
|
||||||
|
// Genre 内容类型/分类筛选。
|
||||||
Genre *string `query:"genre"`
|
Genre *string `query:"genre"`
|
||||||
|
// TenantID 租户ID筛选(内容所属店铺)。
|
||||||
TenantID *int64 `query:"tenantId"`
|
TenantID *int64 `query:"tenantId"`
|
||||||
|
// Sort 排序规则(latest/hot/price_asc)。
|
||||||
Sort *string `query:"sort"`
|
Sort *string `query:"sort"`
|
||||||
|
// IsPinned 置顶内容筛选(true 仅返回置顶)。
|
||||||
IsPinned *bool `query:"is_pinned"`
|
IsPinned *bool `query:"is_pinned"`
|
||||||
|
// PriceType 价格类型筛选(free/paid)。
|
||||||
PriceType *string `query:"price_type"`
|
PriceType *string `query:"price_type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContentItem struct {
|
type ContentItem struct {
|
||||||
|
// ID 内容唯一ID。
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
// TenantID 内容所属租户ID。
|
// TenantID 内容所属租户ID。
|
||||||
TenantID int64 `json:"tenant_id"`
|
TenantID int64 `json:"tenant_id"`
|
||||||
// UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。
|
// UserID 内容作者用户ID(与 author_id 同义,便于后台展示)。
|
||||||
UserID int64 `json:"user_id"`
|
UserID int64 `json:"user_id"`
|
||||||
|
// Title 内容标题。
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
|
// Cover 封面URL(无封面时为空)。
|
||||||
Cover string `json:"cover"`
|
Cover string `json:"cover"`
|
||||||
|
// Genre 内容分类/风格标签。
|
||||||
Genre string `json:"genre"`
|
Genre string `json:"genre"`
|
||||||
Type string `json:"type"` // video, audio, article
|
// Type 内容媒体类型(video/audio/article)。
|
||||||
|
Type string `json:"type"`
|
||||||
// Status 内容状态(如 published/unpublished)。
|
// Status 内容状态(如 published/unpublished)。
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
// Visibility 内容可见性(如 public/tenant_only/private)。
|
// Visibility 内容可见性(如 public/tenant_only/private)。
|
||||||
Visibility string `json:"visibility"`
|
Visibility string `json:"visibility"`
|
||||||
|
// Price 价格(单位元,免费为 0)。
|
||||||
Price float64 `json:"price"`
|
Price float64 `json:"price"`
|
||||||
|
// AuthorID 作者用户ID。
|
||||||
AuthorID int64 `json:"author_id"`
|
AuthorID int64 `json:"author_id"`
|
||||||
|
// AuthorName 作者展示名(优先昵称)。
|
||||||
AuthorName string `json:"author_name"`
|
AuthorName string `json:"author_name"`
|
||||||
// AuthorAvatar 作者头像URL。
|
// AuthorAvatar 作者头像URL。
|
||||||
AuthorAvatar string `json:"author_avatar"`
|
AuthorAvatar string `json:"author_avatar"`
|
||||||
|
// AuthorIsFollowing 当前用户是否关注作者(未登录默认 false)。
|
||||||
AuthorIsFollowing bool `json:"author_is_following"`
|
AuthorIsFollowing bool `json:"author_is_following"`
|
||||||
|
// Views 浏览量统计。
|
||||||
Views int `json:"views"`
|
Views int `json:"views"`
|
||||||
|
// Likes 点赞数统计。
|
||||||
Likes int `json:"likes"`
|
Likes int `json:"likes"`
|
||||||
|
// CreatedAt 创建时间(RFC3339 格式)。
|
||||||
CreatedAt string `json:"created_at"`
|
CreatedAt string `json:"created_at"`
|
||||||
// PublishedAt 发布时间,未发布为空。
|
// PublishedAt 发布时间,未发布为空。
|
||||||
PublishedAt string `json:"published_at"`
|
PublishedAt string `json:"published_at"`
|
||||||
|
// IsPurchased 是否已购买(用于内容列表快速判断)。
|
||||||
IsPurchased bool `json:"is_purchased"`
|
IsPurchased bool `json:"is_purchased"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContentDetail struct {
|
type ContentDetail struct {
|
||||||
ContentItem
|
ContentItem
|
||||||
|
// Description 内容描述(用于详情页摘要)。
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
// Body 详细正文/图文内容(文章类可为空)。
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
|
// MediaUrls 关联媒体资源(音频/视频/预览)。
|
||||||
MediaUrls []MediaURL `json:"media_urls"`
|
MediaUrls []MediaURL `json:"media_urls"`
|
||||||
|
// Meta 内容元信息(曲风/调性/节拍等)。
|
||||||
Meta Meta `json:"meta"`
|
Meta Meta `json:"meta"`
|
||||||
|
// IsLiked 当前用户是否点赞。
|
||||||
IsLiked bool `json:"is_liked"`
|
IsLiked bool `json:"is_liked"`
|
||||||
|
// IsFavorited 当前用户是否收藏。
|
||||||
IsFavorited bool `json:"is_favorited"`
|
IsFavorited bool `json:"is_favorited"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MediaURL struct {
|
type MediaURL struct {
|
||||||
|
// Type 媒体类型(audio/video/image/preview)。
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
// URL 媒体资源地址。
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
|
// Duration 媒体时长(秒),无时长则为 0。
|
||||||
Duration int `json:"duration"`
|
Duration int `json:"duration"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Meta struct {
|
type Meta struct {
|
||||||
|
// Role 内容角色/定位(如 demo/主稿)。
|
||||||
Role string `json:"role"`
|
Role string `json:"role"`
|
||||||
|
// Key 音乐调性或主音。
|
||||||
Key string `json:"key"`
|
Key string `json:"key"`
|
||||||
|
// Beat 节拍信息(如 4/4)。
|
||||||
Beat string `json:"beat"`
|
Beat string `json:"beat"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Comment struct {
|
type Comment struct {
|
||||||
|
// ID 评论ID。
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
|
// Content 评论内容。
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
|
// UserID 评论用户ID。
|
||||||
UserID int64 `json:"user_id"`
|
UserID int64 `json:"user_id"`
|
||||||
|
// UserNickname 评论用户昵称。
|
||||||
UserNickname string `json:"user_nickname"`
|
UserNickname string `json:"user_nickname"`
|
||||||
|
// UserAvatar 评论用户头像。
|
||||||
UserAvatar string `json:"user_avatar"`
|
UserAvatar string `json:"user_avatar"`
|
||||||
|
// CreateTime 评论创建时间(RFC3339)。
|
||||||
CreateTime string `json:"create_time"`
|
CreateTime string `json:"create_time"`
|
||||||
|
// Likes 评论点赞数。
|
||||||
Likes int `json:"likes"`
|
Likes int `json:"likes"`
|
||||||
|
// IsLiked 当前用户是否点赞该评论。
|
||||||
IsLiked bool `json:"is_liked"`
|
IsLiked bool `json:"is_liked"`
|
||||||
|
// ReplyTo 回复的评论ID(0 表示一级评论)。
|
||||||
ReplyTo int64 `json:"reply_to"`
|
ReplyTo int64 `json:"reply_to"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommentCreateForm struct {
|
type CommentCreateForm struct {
|
||||||
|
// Content 评论正文,不能为空。
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
|
// ReplyTo 被回复评论ID(0 表示一级评论)。
|
||||||
ReplyTo int64 `json:"reply_to"`
|
ReplyTo int64 `json:"reply_to"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Topic struct {
|
type Topic struct {
|
||||||
|
// ID 专题ID。
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
|
// Title 专题标题。
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
|
// Cover 专题封面图。
|
||||||
Cover string `json:"cover"`
|
Cover string `json:"cover"`
|
||||||
|
// Tag 专题标签(用于筛选/展示)。
|
||||||
Tag string `json:"tag"`
|
Tag string `json:"tag"`
|
||||||
|
// Count 专题内内容数量。
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContentPrice struct {
|
type ContentPrice struct {
|
||||||
|
// Currency 币种(CNY 等)。
|
||||||
Currency string `json:"currency"`
|
Currency string `json:"currency"`
|
||||||
|
// PriceAmount 原价金额(单位元)。
|
||||||
PriceAmount float64 `json:"price_amount"`
|
PriceAmount float64 `json:"price_amount"`
|
||||||
|
// DiscountType 折扣类型(amount/percent)。
|
||||||
DiscountType string `json:"discount_type"`
|
DiscountType string `json:"discount_type"`
|
||||||
|
// DiscountValue 折扣值(amount=元,percent=百分比)。
|
||||||
DiscountValue float64 `json:"discount_value"`
|
DiscountValue float64 `json:"discount_value"`
|
||||||
|
// DiscountStartAt 折扣开始时间(RFC3339)。
|
||||||
DiscountStartAt string `json:"discount_start_at"`
|
DiscountStartAt string `json:"discount_start_at"`
|
||||||
|
// DiscountEndAt 折扣结束时间(RFC3339)。
|
||||||
DiscountEndAt string `json:"discount_end_at"`
|
DiscountEndAt string `json:"discount_end_at"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user