Files
stream.api/internal/database/model/jobs.gen.go
lethdat bb7f7b0bb3 feat: enhance job and user models with additional fields
- Added VideoID, UserID, and TimeLimit fields to the job model.
- Removed unused referral fields from the user model.
- Updated job creation and update logic to handle new fields.
- Refactored job service to work with updated job model.
- Replaced cache interface with Redis adapter in service layer.
- Introduced a Dead Letter Queue (DLQ) for failed jobs in Redis.
- Updated gRPC server to accommodate changes in job handling.
- Removed obsolete cache package and related files.
2026-03-26 00:33:45 +07:00

41 lines
2.0 KiB
Go

// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
// Code generated by gorm.io/gen. DO NOT EDIT.
package model
import (
"time"
)
const TableNameJob = "jobs"
// Job mapped from table <jobs>
type Job struct {
ID string `gorm:"column:id;type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
Status *string `gorm:"column:status;type:text" json:"status"`
Priority *int64 `gorm:"column:priority;type:bigint;index:idx_jobs_priority,priority:1" json:"priority"`
InputURL *string `gorm:"column:input_url;type:text" json:"input_url"`
OutputURL *string `gorm:"column:output_url;type:text" json:"output_url"`
TotalDuration *int64 `gorm:"column:total_duration;type:bigint" json:"total_duration"`
CurrentTime *int64 `gorm:"column:current_time;type:bigint" json:"current_time"`
Progress *float64 `gorm:"column:progress;type:numeric" json:"progress"`
AgentID *int64 `gorm:"column:agent_id;type:bigint" json:"agent_id"`
Logs *string `gorm:"column:logs;type:text" json:"logs"`
Config *string `gorm:"column:config;type:text" json:"config"`
Cancelled *bool `gorm:"column:cancelled;type:boolean" json:"cancelled"`
RetryCount *int64 `gorm:"column:retry_count;type:bigint" json:"retry_count"`
MaxRetries *int64 `gorm:"column:max_retries;type:bigint;default:3" json:"max_retries"`
CreatedAt *time.Time `gorm:"column:created_at;type:timestamp with time zone" json:"created_at"`
UpdatedAt *time.Time `gorm:"column:updated_at;type:timestamp with time zone" json:"updated_at"`
Version *int64 `gorm:"column:version;type:bigint;version" json:"-"`
VideoID *string `gorm:"column:video_id;type:uuid" json:"video_id"`
UserID *string `gorm:"column:user_id;type:uuid" json:"user_id"`
TimeLimit *int64 `gorm:"column:time_limit;type:bigint;default:3600000" json:"time_limit"`
}
// TableName Job's table name
func (*Job) TableName() string {
return TableNameJob
}