98 lines
2.8 KiB
Go
98 lines
2.8 KiB
Go
package dto
|
||
|
||
import "quyun/v2/app/requests"
|
||
|
||
type ContentListFilter struct {
|
||
requests.Pagination
|
||
Keyword *string `query:"keyword"`
|
||
Genre *string `query:"genre"`
|
||
TenantID *int64 `query:"tenantId"`
|
||
Sort *string `query:"sort"`
|
||
IsPinned *bool `query:"is_pinned"`
|
||
PriceType *string `query:"price_type"`
|
||
}
|
||
|
||
type ContentItem struct {
|
||
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 {
|
||
ContentItem
|
||
Description string `json:"description"`
|
||
Body string `json:"body"`
|
||
MediaUrls []MediaURL `json:"media_urls"`
|
||
Meta Meta `json:"meta"`
|
||
IsLiked bool `json:"is_liked"`
|
||
IsFavorited bool `json:"is_favorited"`
|
||
}
|
||
|
||
type MediaURL struct {
|
||
Type string `json:"type"`
|
||
URL string `json:"url"`
|
||
Duration int `json:"duration"`
|
||
}
|
||
|
||
type Meta struct {
|
||
Role string `json:"role"`
|
||
Key string `json:"key"`
|
||
Beat string `json:"beat"`
|
||
}
|
||
|
||
type Comment struct {
|
||
ID int64 `json:"id"`
|
||
Content string `json:"content"`
|
||
UserID int64 `json:"user_id"`
|
||
UserNickname string `json:"user_nickname"`
|
||
UserAvatar string `json:"user_avatar"`
|
||
CreateTime string `json:"create_time"`
|
||
Likes int `json:"likes"`
|
||
IsLiked bool `json:"is_liked"`
|
||
ReplyTo int64 `json:"reply_to"`
|
||
}
|
||
|
||
type CommentCreateForm struct {
|
||
Content string `json:"content"`
|
||
ReplyTo int64 `json:"reply_to"`
|
||
}
|
||
|
||
type Topic struct {
|
||
ID int64 `json:"id"`
|
||
Title string `json:"title"`
|
||
Cover string `json:"cover"`
|
||
Tag string `json:"tag"`
|
||
Count int `json:"count"`
|
||
}
|
||
|
||
type ContentPrice struct {
|
||
Currency string `json:"currency"`
|
||
PriceAmount float64 `json:"price_amount"`
|
||
DiscountType string `json:"discount_type"`
|
||
DiscountValue float64 `json:"discount_value"`
|
||
DiscountStartAt string `json:"discount_start_at"`
|
||
DiscountEndAt string `json:"discount_end_at"`
|
||
}
|