代码初始化

This commit is contained in:
2026-05-20 11:32:39 +08:00
parent 219b7e39c7
commit e76bf57d54
20 changed files with 1585 additions and 309 deletions

View File

@@ -0,0 +1,63 @@
package audio
import "gitea.com/red-future/common/beans"
// TranscribeTask 语音转文字任务批次头实体
type TranscribeTask struct {
beans.SQLBaseDO `orm:",inherit"`
TaskID string `orm:"task_id" json:"taskId" description:"任务批次唯一标识"`
Status string `orm:"status" json:"status" description:"任务状态:pending/running/success/failed"`
Progress int `orm:"progress" json:"progress" description:"进度0-100"`
TotalFiles int `orm:"total_files" json:"totalFiles" description:"文件总数"`
SuccessFiles int `orm:"success_files" json:"successFiles" description:"成功文件数"`
FailFiles int `orm:"fail_files" json:"failFiles" description:"失败文件数"`
Model string `orm:"model" json:"model" description:"whisper模型"`
Language string `orm:"language" json:"language" description:"语言"`
Threshold float64 `orm:"threshold" json:"threshold" description:"场景检测阈值"`
InputType string `orm:"input_type" json:"inputType" description:"输入类型:upload/url"`
InputData string `orm:"input_data" json:"inputData" description:"输入数据(文件路径/URL列表JSON)"`
FileNames string `orm:"file_names" json:"fileNames" description:"文件名列表JSON"`
CallbackURL string `orm:"callback_url" json:"callbackUrl" description:"任务完成后的回调地址"`
Result string `orm:"result" json:"result" description:"完整的处理结果JSON"`
ErrorMessage string `orm:"error_message" json:"errorMessage" description:"错误信息"`
}
// TranscribeTaskCol 字段定义
type TranscribeTaskCol struct {
beans.SQLBaseCol
TaskID string
Status string
Progress string
TotalFiles string
SuccessFiles string
FailFiles string
Model string
Language string
Threshold string
InputType string
InputData string
FileNames string
CallbackURL string
Result string
ErrorMessage string
}
// TranscribeTaskCols 字段常量
var TranscribeTaskCols = TranscribeTaskCol{
SQLBaseCol: beans.DefSQLBaseCol,
TaskID: "task_id",
Status: "status",
Progress: "progress",
TotalFiles: "total_files",
SuccessFiles: "success_files",
FailFiles: "fail_files",
Model: "model",
Language: "language",
Threshold: "threshold",
InputType: "input_type",
InputData: "input_data",
FileNames: "file_names",
CallbackURL: "callback_url",
Result: "result",
ErrorMessage: "error_message",
}

View File

@@ -0,0 +1,48 @@
package audio
import "gitea.com/red-future/common/beans"
// TranscribeTaskDetail 语音转文字任务明细实体(每视频一条)
type TranscribeTaskDetail struct {
beans.SQLBaseDO `orm:",inherit"`
TaskID string `orm:"task_id" json:"taskId" description:"所属任务批次ID"`
FileIndex int `orm:"file_index" json:"fileIndex" description:"文件序号(从0开始)"`
FileName string `orm:"file_name" json:"fileName" description:"文件名"`
TranscribedText string `orm:"transcribed_text" json:"transcribedText" description:"语音识别文字"`
Scenes string `orm:"scenes" json:"scenes" description:"分镜分析JSON"`
AudioSize int64 `orm:"audio_size" json:"audioSize" description:"音频文件大小(字节)"`
AudioDuration string `orm:"audio_duration" json:"audioDuration" description:"音频时长"`
Model string `orm:"model" json:"model" description:"whisper模型"`
Language string `orm:"language" json:"language" description:"语言代码"`
ErrorMessage string `orm:"error_message" json:"errorMessage" description:"错误信息"`
}
// TranscribeTaskDetailCol 字段定义
type TranscribeTaskDetailCol struct {
beans.SQLBaseCol
TaskID string
FileIndex string
FileName string
TranscribedText string
Scenes string
AudioSize string
AudioDuration string
Model string
Language string
ErrorMessage string
}
// TranscribeTaskDetailCols 字段常量
var TranscribeTaskDetailCols = TranscribeTaskDetailCol{
SQLBaseCol: beans.DefSQLBaseCol,
TaskID: "task_id",
FileIndex: "file_index",
FileName: "file_name",
TranscribedText: "transcribed_text",
Scenes: "scenes",
AudioSize: "audio_size",
AudioDuration: "audio_duration",
Model: "model",
Language: "language",
ErrorMessage: "error_message",
}