feat: implement new structure
This commit is contained in:
84
backend/app/http/v1/dto/content.go
Normal file
84
backend/app/http/v1/dto/content.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package dto
|
||||
|
||||
import "quyun/v2/app/requests"
|
||||
|
||||
type ContentItem struct {
|
||||
ID string `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 string `json:"authorId"`
|
||||
AuthorName string `json:"authorName"`
|
||||
AuthorAvatar string `json:"authorAvatar"`
|
||||
Views int `json:"views"`
|
||||
Likes int `json:"likes"`
|
||||
IsPurchased bool `json:"isPurchased"`
|
||||
}
|
||||
|
||||
type ContentDetail struct {
|
||||
ContentItem
|
||||
Description string `json:"description"`
|
||||
Body string `json:"body"`
|
||||
MediaUrls []MediaURL `json:"mediaUrls"`
|
||||
Meta Meta `json:"meta"`
|
||||
IsLiked bool `json:"isLiked"`
|
||||
IsFavorited bool `json:"isFavorited"`
|
||||
}
|
||||
|
||||
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 string `json:"id"`
|
||||
Content string `json:"content"`
|
||||
UserID string `json:"userId"`
|
||||
UserNickname string `json:"userNickname"`
|
||||
UserAvatar string `json:"userAvatar"`
|
||||
CreateTime string `json:"createTime"`
|
||||
Likes int `json:"likes"`
|
||||
IsLiked bool `json:"isLiked"`
|
||||
ReplyTo string `json:"replyTo"`
|
||||
}
|
||||
|
||||
type CommentListResponse struct {
|
||||
Data []Comment `json:"data"`
|
||||
Pagination requests.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type CommentCreateForm struct {
|
||||
Content string `json:"content"`
|
||||
ReplyTo string `json:"replyTo"`
|
||||
}
|
||||
|
||||
type ContentListResponse struct {
|
||||
Data []ContentItem `json:"data"`
|
||||
Pagination requests.Pagination `json:"pagination"`
|
||||
}
|
||||
|
||||
type Topic struct {
|
||||
ID string `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:"priceAmount"`
|
||||
DiscountType string `json:"discountType"`
|
||||
DiscountValue float64 `json:"discountValue"`
|
||||
DiscountStartAt string `json:"discountStartAt"`
|
||||
DiscountEndAt string `json:"discountEndAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user