优化页面、修复BUG
This commit is contained in:
@@ -83,17 +83,39 @@ func (va *VideoAlbum) BeforeUpdate(tx *gorm.DB) error {
|
||||
|
||||
// VideoAlbumResponse 视频专辑 API 响应
|
||||
type VideoAlbumResponse struct {
|
||||
ID uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Cover string `json:"cover"`
|
||||
CategoryID uint `json:"categoryId"`
|
||||
CategoryName string `json:"categoryName,omitempty"`
|
||||
IsActive int `json:"isActive"`
|
||||
SortOrder uint `json:"sortOrder"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
VideoCount int64 `json:"videoCount,omitempty"`
|
||||
ID uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Cover string `json:"cover"`
|
||||
CategoryID uint `json:"categoryId"`
|
||||
CategoryName string `json:"categoryName,omitempty"`
|
||||
IsActive int `json:"isActive"`
|
||||
SortOrder uint `json:"sortOrder"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
VideoCount int64 `json:"videoCount,omitempty"`
|
||||
LatestVideoUpdatedAt string `json:"latestVideoUpdatedAt,omitempty"`
|
||||
PreviewVideos []VideoResponse `json:"previewVideos,omitempty"`
|
||||
}
|
||||
|
||||
// VideoAlbumNavContext 视频详情页专辑内前后导航
|
||||
type VideoAlbumNavContext struct {
|
||||
AlbumID uint `json:"albumId"`
|
||||
AlbumName string `json:"albumName"`
|
||||
PrevVideos []VideoResponse `json:"prevVideos"`
|
||||
NextVideos []VideoResponse `json:"nextVideos"`
|
||||
}
|
||||
|
||||
// VideoDetailResponse 视频详情 API 响应(含专辑导航)
|
||||
type VideoDetailResponse struct {
|
||||
VideoResponse
|
||||
AlbumContext *VideoAlbumNavContext `json:"albumContext,omitempty"`
|
||||
}
|
||||
|
||||
// AdminVideoResponse 管理端视频响应(含所属专辑 ID)
|
||||
type AdminVideoResponse struct {
|
||||
VideoResponse
|
||||
AlbumIDs []uint `json:"albumIds,omitempty"`
|
||||
}
|
||||
|
||||
// Video 视频模型
|
||||
|
||||
Reference in New Issue
Block a user