引包目录名调整
This commit is contained in:
@@ -1,151 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CreateAudioReq 创建音频请求
|
||||
type CreateAudioReq struct {
|
||||
g.Meta `path:"/createAudio" method:"post" tags:"音频管理" summary:"创建音频" dc:"创建新的音频"`
|
||||
// 基础信息
|
||||
Name string `json:"name" v:"required" dc:"音频名称"`
|
||||
Description string `json:"description" dc:"音频描述"`
|
||||
ScriptText string `json:"scriptText" v:"required" dc:"话术文本"`
|
||||
// 音色配置
|
||||
Voice string `json:"voice" dc:"音色:serena/vivian/uncle_fu/ryan/aiden/ono_anna/sohee/eric/dylan,默认serena"`
|
||||
VoiceType string `json:"voiceType" dc:"音色类型:preset/custom(预设/自定义),默认preset"`
|
||||
CustomVoice string `json:"customVoice" dc:"自定义音色ID(用于声音克隆),voiceType=custom时必填"`
|
||||
}
|
||||
|
||||
// CreateAudioRes 创建音频响应
|
||||
type CreateAudioRes struct {
|
||||
Id int64 `json:"id" dc:"音频ID"`
|
||||
}
|
||||
|
||||
// ListAudioReq 获取音频列表请求
|
||||
type ListAudioReq struct {
|
||||
g.Meta `path:"/listAudios" method:"get" tags:"音频管理" summary:"获取音频列表" dc:"分页查询音频列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
Status consts.AudioStatus `json:"status" dc:"状态:0生成中/1成功/2失败"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListAudioRes 获取音频列表响应
|
||||
type ListAudioRes struct {
|
||||
List []*AudioListItem `json:"list" dc:"音频列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// AudioListItem 音频列表项
|
||||
type AudioListItem struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
ScriptText string `json:"scriptText"`
|
||||
AudioURL string `json:"audioUrl"`
|
||||
Status consts.AudioStatus `json:"status"`
|
||||
ErrorMsg string `json:"errorMsg"`
|
||||
Duration int `json:"duration"`
|
||||
ExternalID string `json:"externalId"`
|
||||
Voice string `json:"voice"`
|
||||
VoiceType string `json:"voiceType"`
|
||||
CustomVoice string `json:"customVoice"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetAudioReq 获取音频详情请求
|
||||
type GetAudioReq struct {
|
||||
g.Meta `path:"/getAudio" method:"get" tags:"音频管理" summary:"获取音频详情" dc:"获取音频详情"`
|
||||
ID int64 `json:"id" v:"required" dc:"音频ID"`
|
||||
}
|
||||
|
||||
// GetAudioRes 获取音频详情响应
|
||||
type GetAudioRes struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
ScriptText string `json:"scriptText"`
|
||||
AudioURL string `json:"audioUrl"`
|
||||
Status consts.AudioStatus `json:"status"`
|
||||
ErrorMsg string `json:"errorMsg"`
|
||||
Duration int `json:"duration"`
|
||||
ExternalID string `json:"externalId"`
|
||||
Voice string `json:"voice"`
|
||||
VoiceType string `json:"voiceType"`
|
||||
CustomVoice string `json:"customVoice"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// UpdateAudioReq 更新音频请求
|
||||
type UpdateAudioReq struct {
|
||||
g.Meta `path:"/updateAudio" method:"put" tags:"音频管理" summary:"更新音频" dc:"更新音频信息"`
|
||||
ID int64 `json:"id" v:"required" dc:"音频ID"`
|
||||
// 基础信息
|
||||
Name string `json:"name" dc:"音频名称"`
|
||||
Description string `json:"description" dc:"音频描述"`
|
||||
// 音色配置
|
||||
Voice string `json:"voice" dc:"音色"`
|
||||
VoiceType string `json:"voiceType" dc:"音色类型"`
|
||||
CustomVoice string `json:"customVoice" dc:"自定义音色ID"`
|
||||
}
|
||||
|
||||
// DeleteAudioReq 删除音频请求
|
||||
type DeleteAudioReq struct {
|
||||
g.Meta `path:"/deleteAudio" method:"delete" tags:"音频管理" summary:"删除音频" dc:"删除音频"`
|
||||
ID int64 `json:"id" v:"required" dc:"音频ID"`
|
||||
}
|
||||
|
||||
// GenerateAudioReq 生成音频请求
|
||||
type GenerateAudioReq struct {
|
||||
g.Meta `path:"/generateAudio" method:"post" tags:"音频管理" summary:"生成音频" dc:"根据话术文本生成音频"`
|
||||
ID int64 `json:"id" v:"required" dc:"音频ID"`
|
||||
}
|
||||
|
||||
// GenerateAudioRes 生成音频响应
|
||||
type GenerateAudioRes struct {
|
||||
TaskID string `json:"taskId" dc:"任务ID"`
|
||||
}
|
||||
|
||||
// TTSReq 文本转语音请求
|
||||
type TTSReq struct {
|
||||
g.Meta `path:"/tts" method:"post" tags:"音频管理" summary:"文本转语音" dc:"将文本转换为语音,直接返回MP3二进制数据"`
|
||||
Text string `json:"text" v:"required" dc:"要转换的文本内容"`
|
||||
Voice string `json:"voice" dc:"音色:默认default"`
|
||||
Speed int `json:"speed" dc:"语速:0.5-2.0,默认1.0"`
|
||||
}
|
||||
|
||||
// TTSRes 文本转语音响应(返回二进制MP3数据)
|
||||
type TTSRes struct {
|
||||
g.Meta `mime:"audio/mpeg"`
|
||||
Data []byte `json:"-" dc:"MP3音频二进制数据"`
|
||||
}
|
||||
|
||||
// GetAudioStatusOptionsReq 获取音频状态选项请求
|
||||
type GetAudioStatusOptionsReq struct {
|
||||
g.Meta `path:"/getAudioStatusOptions" method:"get" tags:"音频管理" summary:"获取音频状态选项" dc:"获取所有音频状态的选项列表"`
|
||||
}
|
||||
|
||||
// GetAudioStatusOptionsRes 获取音频状态选项响应
|
||||
type GetAudioStatusOptionsRes struct {
|
||||
Options []consts.AudioStatusKeyValue `json:"options" dc:"音频状态选项列表"`
|
||||
}
|
||||
|
||||
// Qwen3TTSRequest Qwen3-TTS 请求结构
|
||||
type Qwen3TTSRequest struct {
|
||||
Text string `json:"text"`
|
||||
Speaker string `json:"speaker"` // 预设音色名或克隆音色ID
|
||||
VoiceID string `json:"voice_id,omitempty"` // 克隆音色ID(可选)
|
||||
}
|
||||
|
||||
// Qwen3TTSResponse Qwen3-TTS 响应结构
|
||||
type Qwen3TTSResponse struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Audio string `json:"audio"` // base64编码的音频数据
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CreateCustomVoiceReq 创建自定义音色请求
|
||||
type CreateCustomVoiceReq struct {
|
||||
g.Meta `path:"/createCustomVoice" method:"post" tags:"自定义音色" summary:"创建自定义音色" dc:"上传参考音频创建自定义音色"`
|
||||
VoiceType string `json:"voiceType" v:"required" dc:"音色类型 design/clone(设计/克隆)"`
|
||||
Name string `json:"name" v:"required" dc:"音色名称"`
|
||||
Description string `json:"description" dc:"音色描述"`
|
||||
Text string `json:"text" dc:"参考文本"`
|
||||
// 参考音频
|
||||
ReferenceAudio []byte `json:"referenceAudio" dc:"参考音频数据(base64编码的WAV文件,voiceType=clone 时必填)"`
|
||||
}
|
||||
|
||||
// CreateCustomVoiceRes 创建自定义音色响应
|
||||
type CreateCustomVoiceRes struct {
|
||||
VoiceID string `json:"voiceId" dc:"音色ID"`
|
||||
}
|
||||
|
||||
// ListCustomVoiceReq 获取自定义音色列表请求
|
||||
type ListCustomVoiceReq struct {
|
||||
g.Meta `path:"/listCustomVoices" method:"get" tags:"自定义音色" summary:"获取自定义音色列表" dc:"分页查询自定义音色列表"`
|
||||
*beans.Page
|
||||
}
|
||||
|
||||
// ListCustomVoiceRes 获取自定义音色列表响应
|
||||
type ListCustomVoiceRes struct {
|
||||
List []*CustomVoiceItem `json:"list" dc:"自定义音色列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// CustomVoiceItem 自定义音色列表项
|
||||
type CustomVoiceItem struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status int `json:"status" dc:"状态:0生成中/1成功/2失败"`
|
||||
ErrorMsg string `json:"errorMsg" dc:"错误信息"`
|
||||
OssFile string `json:"ossFile" dc:"结果文件OSS地址"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// DeleteCustomVoiceReq 删除自定义音色请求
|
||||
type DeleteCustomVoiceReq struct {
|
||||
g.Meta `path:"/deleteCustomVoice" method:"delete" tags:"自定义音色" summary:"删除自定义音色" dc:"删除自定义音色"`
|
||||
VoiceID string `json:"voiceId" v:"required" dc:"音色ID"`
|
||||
}
|
||||
|
||||
// Qwen3VoiceCloneRequest Qwen3-TTS 音色克隆请求
|
||||
type Qwen3VoiceCloneRequest struct {
|
||||
Name string `json:"name"` // 音色名称
|
||||
Audio string `json:"audio"` // base64编码的参考音频
|
||||
Text string `json:"text"` // 参考文本(可选)
|
||||
}
|
||||
|
||||
// Qwen3VoiceCloneResponse Qwen3-TTS 音色克隆响应
|
||||
type Qwen3VoiceCloneResponse struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
VoiceID string `json:"voice_id"` // 克隆后的音色ID
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CreateDigitalHumanReq 创建数字人形象请求
|
||||
type CreateDigitalHumanReq struct {
|
||||
g.Meta `path:"/createDigitalHuman" method:"post" tags:"数字人形象管理" summary:"创建数字人形象" dc:"创建新的数字人形象"`
|
||||
// 基础信息
|
||||
Name string `json:"name" v:"required" dc:"数字人名称"`
|
||||
Description string `json:"description" dc:"数字人描述"`
|
||||
ImageURL string `json:"imageUrl" dc:"形象图片URL"`
|
||||
VideoURL string `json:"videoUrl" dc:"形象视频URL"`
|
||||
Status consts.DigitalHumanStatus `json:"status" dc:"状态:1启用/0停用" d:"1"`
|
||||
Tags []string `json:"tags" dc:"标签"`
|
||||
Gender consts.Gender `json:"gender" dc:"性别"`
|
||||
Age consts.Age `json:"age" dc:"年龄段"`
|
||||
Style consts.Style `json:"style" dc:"风格:商务/休闲/正式等"`
|
||||
ExternalID string `json:"externalId" dc:"外部系统ID"`
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
}
|
||||
|
||||
// CreateDigitalHumanRes 创建数字人形象响应
|
||||
type CreateDigitalHumanRes struct {
|
||||
Id int64 `json:"id" dc:"数字人形象ID"`
|
||||
}
|
||||
|
||||
// ListDigitalHumanReq 获取数字人形象列表请求
|
||||
type ListDigitalHumanReq struct {
|
||||
g.Meta `path:"/listDigitalHumans" method:"get" tags:"数字人形象管理" summary:"获取数字人形象列表" dc:"分页查询数字人形象列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
Status consts.DigitalHumanStatus `json:"status" dc:"状态"`
|
||||
Gender consts.Gender `json:"gender" dc:"性别"`
|
||||
Style consts.Style `json:"style" dc:"风格"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListDigitalHumanRes 获取数字人形象列表响应
|
||||
type ListDigitalHumanRes struct {
|
||||
List []*DigitalHumanListItem `json:"list" dc:"数字人形象列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// DigitalHumanListItem 数字人形象列表项
|
||||
type DigitalHumanListItem struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
VideoURL string `json:"videoUrl"`
|
||||
Status consts.DigitalHumanStatus `json:"status"`
|
||||
Tags []string `json:"tags"`
|
||||
Gender consts.Gender `json:"gender"`
|
||||
Age consts.Age `json:"age"`
|
||||
Style consts.Style `json:"style"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetDigitalHumanReq 获取数字人形象详情请求
|
||||
type GetDigitalHumanReq struct {
|
||||
g.Meta `path:"/getDigitalHuman" method:"get" tags:"数字人形象管理" summary:"获取数字人形象详情" dc:"获取数字人形象详情"`
|
||||
ID int64 `json:"id" v:"required" dc:"数字人形象ID"`
|
||||
}
|
||||
|
||||
// GetDigitalHumanRes 获取数字人形象详情响应
|
||||
type GetDigitalHumanRes struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
VideoURL string `json:"videoUrl"`
|
||||
Status consts.DigitalHumanStatus `json:"status"`
|
||||
Tags []string `json:"tags"`
|
||||
Gender consts.Gender `json:"gender"`
|
||||
Age consts.Age `json:"age"`
|
||||
Style consts.Style `json:"style"`
|
||||
ExternalID string `json:"externalId"`
|
||||
Metadata []map[string]interface{} `json:"metadata"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// UpdateDigitalHumanReq 更新数字人形象请求
|
||||
type UpdateDigitalHumanReq struct {
|
||||
g.Meta `path:"/updateDigitalHuman" method:"put" tags:"数字人形象管理" summary:"更新数字人形象" dc:"更新数字人形象信息"`
|
||||
ID int64 `json:"id" v:"required" dc:"数字人形象ID"`
|
||||
// 基础信息
|
||||
Name string `json:"name" dc:"数字人名称"`
|
||||
Description string `json:"description" dc:"数字人描述"`
|
||||
ImageURL string `json:"imageUrl" dc:"形象图片URL"`
|
||||
VideoURL string `json:"videoUrl" dc:"形象视频URL"`
|
||||
Status consts.DigitalHumanStatus `json:"status" dc:"状态:1启用/0停用"`
|
||||
Tags []string `json:"tags" dc:"标签"`
|
||||
Gender consts.Gender `json:"gender" dc:"性别"`
|
||||
Age consts.Age `json:"age" dc:"年龄段"`
|
||||
Style consts.Style `json:"style" dc:"风格:商务/休闲/正式等"`
|
||||
ExternalID string `json:"externalId" dc:"外部系统ID"`
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
}
|
||||
|
||||
// UpdateDigitalHumanStatusReq 更新数字人形象状态请求
|
||||
type UpdateDigitalHumanStatusReq struct {
|
||||
g.Meta `path:"/updateDigitalHumanStatus" method:"put" tags:"数字人形象管理" summary:"更新数字人形象状态" dc:"更新数字人形象状态"`
|
||||
ID int64 `json:"id" v:"required" dc:"数字人形象ID"`
|
||||
Status consts.DigitalHumanStatus `json:"status" v:"required|in:1,0" dc:"状态:1启用/0停用"`
|
||||
}
|
||||
|
||||
// DeleteDigitalHumanReq 删除数字人形象请求
|
||||
type DeleteDigitalHumanReq struct {
|
||||
g.Meta `path:"/deleteDigitalHuman" method:"delete" tags:"数字人形象管理" summary:"删除数字人形象" dc:"删除数字人形象"`
|
||||
ID int64 `json:"id" v:"required" dc:"数字人形象ID"`
|
||||
}
|
||||
|
||||
// GetDigitalHumanStatusOptionsReq 获取数字人状态选项请求
|
||||
type GetDigitalHumanStatusOptionsReq struct {
|
||||
g.Meta `path:"/getDigitalHumanStatusOptions" method:"get" tags:"数字人形象管理" summary:"获取数字人状态选项" dc:"获取所有数字人状态的选项列表"`
|
||||
}
|
||||
|
||||
// GetDigitalHumanStatusOptionsRes 获取数字人状态选项响应
|
||||
type GetDigitalHumanStatusOptionsRes struct {
|
||||
Options []consts.StatusKeyValue `json:"options" dc:"状态选项列表"`
|
||||
}
|
||||
|
||||
// GetGenderOptionsReq 获取性别选项请求
|
||||
type GetGenderOptionsReq struct {
|
||||
g.Meta `path:"/getGenderOptions" method:"get" tags:"数字人形象管理" summary:"获取性别选项" dc:"获取所有性别选项列表"`
|
||||
}
|
||||
|
||||
// GetGenderOptionsRes 获取性别选项响应
|
||||
type GetGenderOptionsRes struct {
|
||||
Options []consts.GenderKeyValue `json:"options" dc:"性别选项列表"`
|
||||
}
|
||||
|
||||
// GetAgeOptionsReq 获取年龄段选项请求
|
||||
type GetAgeOptionsReq struct {
|
||||
g.Meta `path:"/getAgeOptions" method:"get" tags:"数字人形象管理" summary:"获取年龄段选项" dc:"获取所有年龄段选项列表"`
|
||||
}
|
||||
|
||||
// GetAgeOptionsRes 获取年龄段选项响应
|
||||
type GetAgeOptionsRes struct {
|
||||
Options []consts.AgeKeyValue `json:"options" dc:"年龄段选项列表"`
|
||||
}
|
||||
|
||||
// GetStyleOptionsReq 获取风格选项请求
|
||||
type GetStyleOptionsReq struct {
|
||||
g.Meta `path:"/getStyleOptions" method:"get" tags:"数字人形象管理" summary:"获取风格选项" dc:"获取所有风格选项列表"`
|
||||
}
|
||||
|
||||
// GetStyleOptionsRes 获取风格选项响应
|
||||
type GetStyleOptionsRes struct {
|
||||
Options []consts.StyleKeyValue `json:"options" dc:"风格选项列表"`
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.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:"分辨率选项列表"`
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type asyncTaskRefCol struct {
|
||||
beans.SQLBaseCol
|
||||
TaskID string
|
||||
State string
|
||||
TableName string
|
||||
BizID string
|
||||
OssFile string
|
||||
ErrorMsg string
|
||||
}
|
||||
|
||||
var AsyncTaskRefCol = asyncTaskRefCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
TaskID: "task_id",
|
||||
State: "state",
|
||||
TableName: "table_name",
|
||||
BizID: "biz_id",
|
||||
OssFile: "oss_file",
|
||||
ErrorMsg: "error_msg",
|
||||
}
|
||||
|
||||
// AsyncTaskRef 异步任务绑定记录(中间件 task_id 绑定业务表)
|
||||
// - state: 保存中间件返回的任务状态(0排队中/1执行中/2成功/3失败/4已下载)
|
||||
type AsyncTaskRef struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
TaskID string `orm:"task_id" json:"taskId"`
|
||||
State int `orm:"state" json:"state"`
|
||||
TableName string `orm:"table_name" json:"tableName"`
|
||||
BizID int64 `orm:"biz_id" json:"bizId,string"`
|
||||
OssFile string `orm:"oss_file" json:"ossFile"`
|
||||
ErrorMsg string `orm:"error_msg" json:"errorMsg"`
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type audioCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Description string
|
||||
ScriptText string
|
||||
AudioURL string
|
||||
Status string
|
||||
ErrorMsg string
|
||||
Duration string
|
||||
ExternalID string
|
||||
Voice string
|
||||
VoiceType string
|
||||
CustomVoice string
|
||||
}
|
||||
|
||||
var AudioCol = audioCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
ScriptText: "script_text",
|
||||
AudioURL: "audio_url",
|
||||
Status: "status",
|
||||
ErrorMsg: "error_msg",
|
||||
Duration: "duration",
|
||||
ExternalID: "external_id",
|
||||
Voice: "voice",
|
||||
VoiceType: "voice_type",
|
||||
CustomVoice: "custom_voice",
|
||||
}
|
||||
|
||||
// Audio 音频实体
|
||||
type Audio struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name"` // 音频名称
|
||||
Description string `orm:"description" json:"description"` // 音频描述
|
||||
ScriptText string `orm:"script_text" json:"scriptText"` // 话术文本
|
||||
AudioURL string `orm:"audio_url" json:"audioUrl"` // 音频文件URL
|
||||
Status consts.AudioStatus `orm:"status" json:"status"` // 状态:0生成中/1成功/2失败
|
||||
ErrorMsg string `orm:"error_msg" json:"errorMsg"` // 错误信息
|
||||
Duration int `orm:"duration" json:"duration"` // 音频时长(秒)
|
||||
ExternalID string `orm:"external_id" json:"externalId"` // 外部音频ID
|
||||
// 音色相关
|
||||
Voice string `orm:"voice" json:"voice"` // 音色:serena/vivian/uncle_fu/ryan/aiden/ono_anna/sohee/eric/dylan
|
||||
VoiceType string `orm:"voice_type" json:"voiceType"` // 音色类型:preset/custom(预设/克隆)
|
||||
CustomVoice string `orm:"custom_voice" json:"customVoice"` // 自定义音色ID(用于声音克隆)
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type customVoiceCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Description string
|
||||
Status string
|
||||
ErrorMsg string
|
||||
OssFile string
|
||||
ReferenceAudio string
|
||||
}
|
||||
|
||||
var CustomVoiceCol = customVoiceCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
Status: "status",
|
||||
ErrorMsg: "error_msg",
|
||||
OssFile: "oss_file",
|
||||
ReferenceAudio: "reference_audio",
|
||||
}
|
||||
|
||||
// CustomVoice 自定义音色实体
|
||||
type CustomVoice struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name"` // 音色名称
|
||||
Description string `orm:"description" json:"description"` // 音色描述
|
||||
Text string `orm:"text" json:"text"` // 参考文本
|
||||
Status int `orm:"status" json:"status"` // 状态:0生成中/1成功/2失败
|
||||
ErrorMsg string `orm:"error_msg" json:"errorMsg"` // 错误信息
|
||||
OssFile string `orm:"oss_file" json:"ossFile"` // 结果文件URL(如参考音频/特征文件等)
|
||||
ReferenceAudio []byte `orm:"reference_audio" json:"referenceAudio"` // 参考音频数据(二进制)
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type digitalHumanCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Description string
|
||||
AvatarURL string
|
||||
VideoURL string
|
||||
Voice string
|
||||
Status string
|
||||
Tags string
|
||||
Gender string
|
||||
Age string
|
||||
Style string
|
||||
ExternalID string
|
||||
Metadata string
|
||||
}
|
||||
|
||||
var DigitalHumanCol = digitalHumanCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
AvatarURL: "avatar_url",
|
||||
VideoURL: "video_url",
|
||||
Voice: "voice",
|
||||
Status: "status",
|
||||
Tags: "tags",
|
||||
Gender: "gender",
|
||||
Age: "age",
|
||||
Style: "style",
|
||||
ExternalID: "external_id",
|
||||
Metadata: "metadata",
|
||||
}
|
||||
|
||||
// DigitalHuman 数字人形象实体
|
||||
type DigitalHuman struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name"` // 数字人名称
|
||||
Description string `orm:"description" json:"description"` // 数字人描述
|
||||
AvatarURL string `orm:"avatar_url" json:"imageUrl"` // 形象图片URL
|
||||
VideoURL string `orm:"video_url" json:"videoUrl"` // 形象视频URL
|
||||
Voice string `orm:"voice" json:"voice"` // 默认音色
|
||||
Status consts.DigitalHumanStatus `orm:"status" json:"status"` // 状态:1启用/0停用
|
||||
Tags []string `orm:"tags" json:"tags"` // 标签
|
||||
Gender consts.Gender `orm:"gender" json:"gender"` // 性别
|
||||
Age consts.Age `orm:"age" json:"age"` // 年龄段
|
||||
Style consts.Style `orm:"style" json:"style"` // 风格:商务/休闲/正式等
|
||||
ExternalID string `orm:"external_id" json:"externalId"` // 外部系统ID
|
||||
Metadata []map[string]interface{} `orm:"metadata" json:"metadata"` // 动态元数据
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/digitalhuman/consts"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type videoCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Description string
|
||||
AudioID string
|
||||
ScriptText string
|
||||
VideoURL string
|
||||
Status string
|
||||
ErrorMsg string
|
||||
Duration string
|
||||
ThumbnailURL string
|
||||
ExternalID string
|
||||
DigitalHumanID string
|
||||
DigitalHumanName string
|
||||
Resolution string
|
||||
}
|
||||
|
||||
var VideoCol = videoCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Description: "description",
|
||||
AudioID: "audio_id",
|
||||
ScriptText: "script_text",
|
||||
VideoURL: "video_url",
|
||||
Status: "status",
|
||||
ErrorMsg: "error_msg",
|
||||
Duration: "duration",
|
||||
ThumbnailURL: "thumbnail_url",
|
||||
ExternalID: "external_id",
|
||||
DigitalHumanID: "digital_human_id",
|
||||
DigitalHumanName: "digital_human_name",
|
||||
Resolution: "resolution",
|
||||
}
|
||||
|
||||
// Video 视频实体
|
||||
type Video struct {
|
||||
beans.SQLBaseDO `orm:",inline"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name"` // 视频名称
|
||||
Description string `orm:"description" json:"description"` // 视频描述
|
||||
DigitalHumanID int64 `orm:"digital_human_id" json:"digitalHumanId"` // 数字人形象ID
|
||||
AudioID int64 `orm:"audio_id" json:"audioId"` // 音频ID
|
||||
ScriptText string `orm:"script_text" json:"scriptText"` // 话术文本
|
||||
VideoURL string `orm:"video_url" json:"videoUrl"` // 合成视频URL
|
||||
Status consts.VideoStatus `orm:"status" json:"status"` // 状态:0生成中/1成功/2失败
|
||||
ErrorMsg string `orm:"error_msg" json:"errorMsg"` // 错误信息
|
||||
Duration int `orm:"duration" json:"duration"` // 视频时长(秒)
|
||||
ThumbnailURL string `orm:"thumbnail_url" json:"thumbnailUrl"` // 缩略图URL
|
||||
ExternalID string `orm:"external_id" json:"externalId"` // 外部任务ID
|
||||
DigitalHumanName string `orm:"digital_human_name" json:"digitalHumanName"` // 数字人名称(冗余字段)
|
||||
Resolution consts.Resolution `orm:"resolution" json:"resolution"` // 分辨率
|
||||
}
|
||||
Reference in New Issue
Block a user