feat: implement async modpack import with websockets

This commit is contained in:
Mrixs committed 2026-01-05 18:06:54 +03:00
1 parent 0751ddb88a
commit 9bf2a15045
8 files changed
+435 -64

No files matched your search

+24
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"`
}