This commit is contained in:
@@ -23,18 +23,19 @@ type Session struct {
|
||||
}
|
||||
|
||||
type SharedFile struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Hash string `gorm:"uniqueIndex;size:8;not null" json:"hash"`
|
||||
OriginalName string `gorm:"not null" json:"name"`
|
||||
MimeType string `gorm:"not null" json:"mimeType"`
|
||||
Size int64 `json:"size"`
|
||||
OwnerID uint `gorm:"index;not null" json:"ownerId"`
|
||||
ExpiresAt *time.Time `gorm:"index" json:"expiresAt"`
|
||||
MaxDownloads *int `json:"maxDownloads"`
|
||||
DownloadCount int `gorm:"not null;default:0" json:"downloadCount"`
|
||||
PickupCodeHash string `json:"-"`
|
||||
Ready bool `gorm:"index;not null;default:false" json:"-"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Hash string `gorm:"uniqueIndex;size:8;not null" json:"hash"`
|
||||
OriginalName string `gorm:"not null" json:"name"`
|
||||
MimeType string `gorm:"not null" json:"mimeType"`
|
||||
Size int64 `json:"size"`
|
||||
OwnerID uint `gorm:"index;not null" json:"ownerId"`
|
||||
ExpiresAt *time.Time `gorm:"index" json:"expiresAt"`
|
||||
MaxDownloads *int `json:"maxDownloads"`
|
||||
DownloadCount int `gorm:"not null;default:0" json:"downloadCount"`
|
||||
PickupCodeHash string `json:"-"`
|
||||
FailedCodeAttempts int `gorm:"not null;default:0" json:"-"`
|
||||
Ready bool `gorm:"index;not null;default:false" json:"-"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (f SharedFile) HasPickupCode() bool { return f.PickupCodeHash != "" }
|
||||
|
||||
Reference in New Issue
Block a user