数字人项目迁移
This commit is contained in:
38
digitalhuman/model/entity/async_task_ref.go
Normal file
38
digitalhuman/model/entity/async_task_ref.go
Normal file
@@ -0,0 +1,38 @@
|
||||
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"`
|
||||
}
|
||||
|
||||
55
digitalhuman/model/entity/audio.go
Normal file
55
digitalhuman/model/entity/audio.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/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(用于声音克隆)
|
||||
}
|
||||
38
digitalhuman/model/entity/custom_voice.go
Normal file
38
digitalhuman/model/entity/custom_voice.go
Normal file
@@ -0,0 +1,38 @@
|
||||
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"` // 参考音频数据(二进制)
|
||||
}
|
||||
57
digitalhuman/model/entity/digitalhuman.go
Normal file
57
digitalhuman/model/entity/digitalhuman.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/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"` // 动态元数据
|
||||
}
|
||||
60
digitalhuman/model/entity/video.go
Normal file
60
digitalhuman/model/entity/video.go
Normal file
@@ -0,0 +1,60 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"digital-human/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