feat: implement async modpack import with websockets

This commit is contained in:
2026-01-05 18:06:54 +03:00
parent 0751ddb88a
commit 9bf2a15045
8 changed files with 435 additions and 64 deletions

24
internal/models/job.go Normal file
View 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"`
}