Files
media/model/entity/audio/transcribe_task.go
2026-05-20 11:32:39 +08:00

64 lines
2.5 KiB
Go

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",
}