Manage display of book covers
This commit is contained in:
@@ -8,4 +8,6 @@ type Book struct {
|
||||
Author string `json:"author"`
|
||||
AddedBy User
|
||||
AddedByID uint
|
||||
Cover StaticFile
|
||||
CoverID uint
|
||||
}
|
||||
|
||||
9
internal/model/file.go
Normal file
9
internal/model/file.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package model
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type StaticFile struct {
|
||||
gorm.Model
|
||||
Name string `gorm:"not null"`
|
||||
Path string `gorm:"not null;index;uniqueIndex"`
|
||||
}
|
||||
Reference in New Issue
Block a user