46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
package models
|
|
|
|
import (
|
|
"gorm.io/gorm"
|
|
"time"
|
|
)
|
|
|
|
type ServerSetting struct {
|
|
gorm.Model
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Email string `json:"email" gorm:"unique;not null"`
|
|
Username string `json:"username" gorm:"unique;not null"`
|
|
FirstName string `json:"first_name"`
|
|
LastName string `json:"last_name"`
|
|
AuthType string `json:"auth_type"`
|
|
HashedPassword string `json:"hashed_password"`
|
|
}
|
|
|
|
type MediaItem struct {
|
|
gorm.Model
|
|
User User `json:"user" gorm:"ForeignKey:ID"`
|
|
EXIFDate time.Time `json:"exif_date"`
|
|
Latitude string `json:"latitude"`
|
|
Longitude string `json:"longitude"`
|
|
MediaType uint `json:"media_type"`
|
|
RelPath string `json:"rel_path"`
|
|
Tags []Tag `json:"tags" gorm:"many2many:media_tags;"`
|
|
Albums []Album `json:"albums" gorm:"many2many:media_albums;"`
|
|
}
|
|
|
|
type Tag struct {
|
|
gorm.Model
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type Album struct {
|
|
gorm.Model
|
|
Name string `json:"name"`
|
|
}
|