This commit is contained in:
Connor
2026-01-12 13:17:11 +08:00
parent 95851f8e69
commit 9600fc542c
132 changed files with 35734 additions and 5 deletions

23
domain/models/task.go Normal file
View File

@@ -0,0 +1,23 @@
package models
import (
"time"
"gorm.io/gorm"
)
// AsyncTask 异步任务模型
type AsyncTask struct {
ID string `gorm:"primaryKey;size:36" json:"id"`
Type string `gorm:"size:50;not null;index" json:"type"` // 任务类型storyboard_generation
Status string `gorm:"size:20;not null;index" json:"status"` // pending, processing, completed, failed
Progress int `gorm:"default:0" json:"progress"` // 0-100
Message string `gorm:"size:500" json:"message,omitempty"` // 当前状态消息
Error string `gorm:"type:text" json:"error,omitempty"` // 错误信息
Result string `gorm:"type:text" json:"result,omitempty"` // JSON格式的结果数据
ResourceID string `gorm:"size:36;index" json:"resource_id"` // 关联资源ID如episode_id
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}