46 lines
789 B
Go
46 lines
789 B
Go
|
package db
|
||
|
|
||
|
import (
|
||
|
"gorm.io/gorm"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type ServerSetting struct {
|
||
|
gorm.Model
|
||
|
Name string
|
||
|
Description string
|
||
|
Value string
|
||
|
}
|
||
|
|
||
|
type User struct {
|
||
|
gorm.Model
|
||
|
Name string
|
||
|
Email string
|
||
|
AuthType string
|
||
|
Salt string
|
||
|
HashedPWSalt string
|
||
|
MediaItems []MediaItem
|
||
|
}
|
||
|
|
||
|
type MediaItem struct {
|
||
|
gorm.Model
|
||
|
User User
|
||
|
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
|
||
|
}
|