Implement file caching for faster retrieval and reduced database load
This commit is contained in:
@ -10,19 +10,12 @@ type User struct {
|
||||
}
|
||||
|
||||
type File struct {
|
||||
ID uuid.UUID `gorm:"primaryKey;not null;unique"`
|
||||
OwnerID uuid.UUID `gorm:"not null"`
|
||||
Name string `gorm:"not null"`
|
||||
Size int `gorm:"not null"`
|
||||
Downloaded int `gorm:"not null;default=0"`
|
||||
}
|
||||
|
||||
type FilesUploaded struct {
|
||||
UploadID uuid.UUID `gorm:"primaryKey;not null;unique"`
|
||||
FileID uuid.UUID `gorm:"not null"`
|
||||
OwnerID uuid.UUID `gorm:"not null"`
|
||||
Name string `gorm:"not null"`
|
||||
Size int `gorm:"not null"`
|
||||
Uploaded int `gorm:"not null;default=0"`
|
||||
Done bool `gorm:"not null;default=false"`
|
||||
ID uuid.UUID `gorm:"primaryKey;not null;unique"`
|
||||
OwnerID uuid.UUID `gorm:"not null"`
|
||||
Name string `gorm:"not null"`
|
||||
Size int64 `gorm:"not null"`
|
||||
Downloaded int64 `gorm:"not null;default=0"`
|
||||
UploadedByte int64 `gorm:"not null;default=0"`
|
||||
UploadedChunk int64 `gorm:"not null;default=0"`
|
||||
Done bool `gorm:"not null;default=false"`
|
||||
}
|
||||
|
@ -18,20 +18,13 @@ type User struct {
|
||||
|
||||
type FileInfo struct {
|
||||
Name string `json:"name"`
|
||||
Size int `json:"size"`
|
||||
Chunk int `json:"chunk"`
|
||||
}
|
||||
|
||||
type FileInfoUploaded struct {
|
||||
Name string `json:"name"`
|
||||
Size int `json:"size"`
|
||||
Chunk int `json:"chunk"`
|
||||
UploadedChunk int `json:"uploaded_chunk"`
|
||||
Size int64 `json:"size"`
|
||||
Chunk int64 `json:"chunk"`
|
||||
}
|
||||
|
||||
type FileData struct {
|
||||
ID string
|
||||
Name string
|
||||
Size string
|
||||
Downloaded int
|
||||
Downloaded int64
|
||||
}
|
||||
|
Reference in New Issue
Block a user