feat: add file visibility toggle for files
This commit is contained in:
@ -18,6 +18,7 @@ type File struct {
|
||||
TotalChunk uint64 `gorm:"not null"`
|
||||
StartHash string `gorm:"type:text;not null"`
|
||||
EndHash string `gorm:"type:text;not null"`
|
||||
IsPrivate bool `gorm:"not null;default:true"`
|
||||
Downloaded uint64 `gorm:"not null;default:0"`
|
||||
Owner *User `gorm:"foreignKey:OwnerID;constraint:OnDelete:CASCADE;"`
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ type FileData struct {
|
||||
ID string
|
||||
Name string
|
||||
Size string
|
||||
IsPrivate bool
|
||||
Downloaded string
|
||||
}
|
||||
|
||||
@ -60,6 +61,7 @@ type Database interface {
|
||||
GetUserFile(name string, ownerID string) (*models.File, error)
|
||||
GetFiles(ownerID string) ([]*models.File, error)
|
||||
IncrementDownloadCount(fileID string) error
|
||||
ChangeFileVisibility(fileID string) error
|
||||
|
||||
InitializeTotp(email string, secret string) error
|
||||
}
|
||||
|
Reference in New Issue
Block a user