Files
nl-video-api/api/v1/user_collect.go
2025-08-03 00:11:15 +08:00

65 lines
2.3 KiB
Go

package v1
import (
"github.com/gogf/gf/v2/frame/g"
)
// UserCollectAddReq 添加收藏请求
type UserCollectAddReq struct {
g.Meta `path:"/user/collect/add" method:"post" summary:"添加收藏" tags:"用户收藏"`
MovieId int `json:"movie_id" v:"required|min:1#影片ID不能为空|影片ID必须大于0" dc:"影片ID"`
}
// UserCollectAddRes 添加收藏响应
type UserCollectAddRes struct {
g.Meta `mime:"application/json"`
}
// UserCollectRemoveReq 取消收藏请求
type UserCollectRemoveReq struct {
g.Meta `path:"/user/collect/remove" method:"post" summary:"取消收藏" tags:"用户收藏"`
MovieId int `json:"movie_id" v:"required|min:1#影片ID不能为空|影片ID必须大于0" dc:"影片ID"`
}
// UserCollectRemoveRes 取消收藏响应
type UserCollectRemoveRes struct {
g.Meta `mime:"application/json"`
}
// UserCollectListReq 收藏列表请求
type UserCollectListReq struct {
g.Meta `path:"/user/collect/list" method:"get" summary:"收藏列表" tags:"用户收藏"`
Page int `json:"page" v:"min:1#页码必须大于0" dc:"页码" default:"1"`
Size int `json:"size" v:"min:1|max:100#每页数量必须大于0|每页数量不能超过100" dc:"每页数量" default:"10"`
}
// UserCollectListRes 收藏列表响应
type UserCollectListRes struct {
g.Meta `mime:"application/json"`
List []UserCollectItem `json:"list" dc:"收藏列表"`
Total int `json:"total" dc:"总数"`
Page int `json:"page" dc:"当前页"`
Size int `json:"size" dc:"每页数量"`
}
// UserCollectItem 收藏项目
type UserCollectItem struct {
Id uint `json:"id" dc:"收藏ID"`
MovieId int `json:"movie_id" dc:"影片ID"`
MovieName string `json:"movie_name" dc:"影片名称"`
MovieCover string `json:"movie_cover" dc:"影片封面"`
CreatedAt string `json:"created_at" dc:"收藏时间"`
}
// UserCollectCheckReq 检查收藏状态请求
type UserCollectCheckReq struct {
g.Meta `path:"/user/collect/check" method:"get" summary:"检查收藏状态" tags:"用户收藏"`
MovieId int `json:"movie_id" v:"required|min:1#影片ID不能为空|影片ID必须大于0" dc:"影片ID"`
}
// UserCollectCheckRes 检查收藏状态响应
type UserCollectCheckRes struct {
g.Meta `mime:"application/json"`
IsCollected bool `json:"is_collected" dc:"是否已收藏"`
}