132 lines
5.4 KiB
Go
132 lines
5.4 KiB
Go
package dto
|
||
|
||
import (
|
||
"ai-agent/digital-human/consts"
|
||
|
||
"gitea.redpowerfuture.com/red-future/common/beans"
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
"github.com/gogf/gf/v2/os/gtime"
|
||
)
|
||
|
||
// CreateVideoReq 创建视频请求
|
||
type CreateVideoReq struct {
|
||
g.Meta `path:"/createVideo" method:"post" tags:"视频管理" summary:"创建视频" dc:"创建新的视频任务"`
|
||
// 基础信息
|
||
Name string `json:"name" v:"required" dc:"视频名称"`
|
||
Description string `json:"description" dc:"视频描述"`
|
||
DigitalHumanID int64 `json:"digitalHumanId" v:"required" dc:"数字人形象ID"`
|
||
AudioID int64 `json:"audioId" v:"required" dc:"音频ID"`
|
||
Resolution consts.Resolution `json:"resolution" dc:"分辨率:480p/720p/1080p/2k/4k/8k"`
|
||
}
|
||
|
||
// CreateVideoRes 创建视频响应
|
||
type CreateVideoRes struct {
|
||
Id int64 `json:"id" dc:"视频ID"`
|
||
}
|
||
|
||
// ListVideoReq 获取视频列表请求
|
||
type ListVideoReq struct {
|
||
g.Meta `path:"/listVideos" method:"get" tags:"视频管理" summary:"获取视频列表" dc:"分页查询视频列表,支持多条件筛选"`
|
||
*beans.Page
|
||
Status consts.VideoStatus `json:"status" dc:"状态:0生成中/1成功/2失败"`
|
||
DigitalHumanID int64 `json:"digitalHumanId" dc:"数字人形象ID"`
|
||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||
}
|
||
|
||
// ListVideoRes 获取视频列表响应
|
||
type ListVideoRes struct {
|
||
List []*VideoListItem `json:"list" dc:"视频列表"`
|
||
Total int64 `json:"total" dc:"总数"`
|
||
}
|
||
|
||
// VideoListItem 视频列表项
|
||
type VideoListItem struct {
|
||
ID int64 `json:"id"`
|
||
Name string `json:"name"`
|
||
Description string `json:"description"`
|
||
DigitalHumanID int64 `json:"digitalHumanId"`
|
||
DigitalHumanName string `json:"digitalHumanName"`
|
||
AudioID int64 `json:"audioId"`
|
||
AudioURL string `json:"audioUrl"`
|
||
VideoURL string `json:"videoUrl"`
|
||
Status consts.VideoStatus `json:"status"`
|
||
ErrorMsg string `json:"errorMsg"`
|
||
Duration int `json:"duration"`
|
||
Resolution consts.Resolution `json:"resolution"`
|
||
ThumbnailURL string `json:"thumbnailUrl"`
|
||
CreatedAt *gtime.Time `json:"createdAt"`
|
||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||
}
|
||
|
||
// GetVideoReq 获取视频详情请求
|
||
type GetVideoReq struct {
|
||
g.Meta `path:"/getVideo" method:"get" tags:"视频管理" summary:"获取视频详情" dc:"获取视频详情"`
|
||
ID int64 `json:"id" v:"required" dc:"视频ID"`
|
||
}
|
||
|
||
// GetVideoRes 获取视频详情响应
|
||
type GetVideoRes struct {
|
||
ID int64 `json:"id"`
|
||
Name string `json:"name"`
|
||
Description string `json:"description"`
|
||
DigitalHumanID int64 `json:"digitalHumanId"`
|
||
DigitalHumanName string `json:"digitalHumanName"`
|
||
AudioID int64 `json:"audioId"`
|
||
AudioURL string `json:"audioUrl"`
|
||
VideoURL string `json:"videoUrl"`
|
||
Status consts.VideoStatus `json:"status"`
|
||
ErrorMsg string `json:"errorMsg"`
|
||
Duration int `json:"duration"`
|
||
Resolution consts.Resolution `json:"resolution"`
|
||
ThumbnailURL string `json:"thumbnailUrl"`
|
||
ExternalTaskID string `json:"externalTaskId"`
|
||
CreatedAt *gtime.Time `json:"createdAt"`
|
||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||
}
|
||
|
||
// UpdateVideoReq 更新视频请求
|
||
type UpdateVideoReq struct {
|
||
g.Meta `path:"/updateVideo" method:"put" tags:"视频管理" summary:"更新视频" dc:"更新视频信息"`
|
||
ID int64 `json:"id" v:"required" dc:"视频ID"`
|
||
// 基础信息
|
||
Name string `json:"name" dc:"视频名称"`
|
||
Description string `json:"description" dc:"视频描述"`
|
||
}
|
||
|
||
// DeleteVideoReq 删除视频请求
|
||
type DeleteVideoReq struct {
|
||
g.Meta `path:"/deleteVideo" method:"delete" tags:"视频管理" summary:"删除视频" dc:"删除视频"`
|
||
ID int64 `json:"id" v:"required" dc:"视频ID"`
|
||
}
|
||
|
||
// GenerateVideoReq 生成视频请求
|
||
type GenerateVideoReq struct {
|
||
g.Meta `path:"/generateVideo" method:"post" tags:"视频管理" summary:"生成视频" dc:"选择数字人,选择已生成的音频,调用数字人形象与音频合成形成视频"`
|
||
ID int64 `json:"id" v:"required" dc:"视频ID"`
|
||
}
|
||
|
||
// GenerateVideoRes 生成视频响应
|
||
type GenerateVideoRes struct {
|
||
TaskID string `json:"taskId" dc:"任务ID"`
|
||
}
|
||
|
||
// GetVideoStatusOptionsReq 获取视频状态选项请求
|
||
type GetVideoStatusOptionsReq struct {
|
||
g.Meta `path:"/getVideoStatusOptions" method:"get" tags:"视频管理" summary:"获取视频状态选项" dc:"获取所有视频状态的选项列表"`
|
||
}
|
||
|
||
// GetVideoStatusOptionsRes 获取视频状态选项响应
|
||
type GetVideoStatusOptionsRes struct {
|
||
Options []consts.VideoStatusKeyValue `json:"options" dc:"视频状态选项列表"`
|
||
}
|
||
|
||
// GetResolutionOptionsReq 获取分辨率选项请求
|
||
type GetResolutionOptionsReq struct {
|
||
g.Meta `path:"/getResolutionOptions" method:"get" tags:"视频管理" summary:"获取分辨率选项" dc:"获取所有分辨率的选项列表"`
|
||
}
|
||
|
||
// GetResolutionOptionsRes 获取分辨率选项响应
|
||
type GetResolutionOptionsRes struct {
|
||
Options []consts.ResolutionKeyValue `json:"options" dc:"分辨率选项列表"`
|
||
}
|