2024-03-22 19:52:11 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
|
|
|
|
type ImportStatus string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ImportStatusQueued ImportStatus = "queued"
|
|
|
|
ImportStatusProcessing ImportStatus = "processing"
|
2024-03-22 22:29:09 +00:00
|
|
|
ImportStatusCompleted ImportStatus = "completed"
|
2024-03-22 19:52:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
registerModel(&Upload{})
|
|
|
|
}
|
|
|
|
|
|
|
|
type Import struct {
|
|
|
|
gorm.Model
|
|
|
|
UserID uint
|
|
|
|
Hash []byte `gorm:"type:binary(32);"`
|
|
|
|
Protocol string
|
|
|
|
User User
|
|
|
|
ImporterIP string
|
|
|
|
Status ImportStatus
|
|
|
|
Progress float64
|
|
|
|
}
|