feat: implement async modpack import with websockets
This commit is contained in:
24
internal/models/job.go
Normal file
24
internal/models/job.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ImportJobStatus определяет возможные статусы задачи импорта
|
||||
type ImportJobStatus string
|
||||
|
||||
const (
|
||||
JobStatusPending ImportJobStatus = "pending"
|
||||
JobStatusDownloading ImportJobStatus = "downloading"
|
||||
JobStatusProcessing ImportJobStatus = "processing"
|
||||
JobStatusCompleted ImportJobStatus = "completed"
|
||||
JobStatusFailed ImportJobStatus = "failed"
|
||||
)
|
||||
|
||||
// ImportJob представляет задачу на импорт модпака
|
||||
type ImportJob struct {
|
||||
ID int `json:"id"`
|
||||
Status ImportJobStatus `json:"status"`
|
||||
Progress int `json:"progress"` // 0-100
|
||||
ErrorMessage string `json:"error_message,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user