- Implemented player_configs table to store multiple player configurations per user. - Migrated existing player settings from user_preferences to player_configs. - Removed player-related columns from user_preferences. - Added referral state fields to user for tracking referral rewards. - Created migration scripts for database changes and data migration. - Added test cases for app services and usage helpers. - Introduced video job service interfaces and implementations.
39 lines
1.4 KiB
Go
39 lines
1.4 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type JobStatus string
|
|
|
|
const (
|
|
JobStatusPending JobStatus = "pending"
|
|
JobStatusRunning JobStatus = "running"
|
|
JobStatusSuccess JobStatus = "success"
|
|
JobStatusFailure JobStatus = "failure"
|
|
JobStatusCancelled JobStatus = "cancelled"
|
|
)
|
|
|
|
type Job struct {
|
|
ID string `json:"id" gorm:"primaryKey;type:uuid;default:gen_random_uuid()"`
|
|
Status JobStatus `json:"status" gorm:"type:varchar(32);index"`
|
|
Priority int `json:"priority" gorm:"default:0;index"`
|
|
UserID string `json:"user_id" gorm:"index"`
|
|
VideoID string `json:"video_id,omitempty"`
|
|
Name string `json:"name"`
|
|
TimeLimit int64 `json:"time_limit"`
|
|
InputURL string `json:"input_url"`
|
|
OutputURL string `json:"output_url"`
|
|
TotalDuration int64 `json:"total_duration"`
|
|
CurrentTime int64 `json:"current_time"`
|
|
Progress float64 `json:"progress"`
|
|
AgentID *string `json:"agent_id" gorm:"type:uuid;index"`
|
|
Logs string `json:"logs" gorm:"type:text"`
|
|
Config string `json:"config" gorm:"type:text"`
|
|
Cancelled bool `json:"cancelled" gorm:"default:false"`
|
|
RetryCount int `json:"retry_count" gorm:"default:0"`
|
|
MaxRetries int `json:"max_retries" gorm:"default:3"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
func (Job) TableName() string { return "render_jobs" }
|