DB & Route Organization
This commit is contained in:
45
internal/models/models.go
Normal file
45
internal/models/models.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ServerSetting struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
Description string
|
||||
Value string
|
||||
}
|
||||
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Email string `gorm:"unique;not null"`
|
||||
Username string `gorm:"unique;not null"`
|
||||
FirstName string
|
||||
LastName string
|
||||
AuthType string
|
||||
HashedPassword string
|
||||
}
|
||||
|
||||
type MediaItem struct {
|
||||
gorm.Model
|
||||
User User `gorm:"ForeignKey:ID"`
|
||||
EXIFDate time.Time
|
||||
Latitude string
|
||||
Longitude string
|
||||
MediaType uint
|
||||
RelPath string
|
||||
Tags []Tag `gorm:"many2many:media_tags;"`
|
||||
Albums []Album `gorm:"many2many:media_albums;"`
|
||||
}
|
||||
|
||||
type Tag struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
}
|
||||
|
||||
type Album struct {
|
||||
gorm.Model
|
||||
Name string
|
||||
}
|
||||
Reference in New Issue
Block a user