nquest/pkg/models/game.go

25 lines
430 B
Go
Raw Normal View History

2023-11-01 23:21:12 +03:00
package models
2024-01-20 21:37:49 +03:00
import "github.com/google/uuid"
2023-11-01 23:21:12 +03:00
type Game struct {
Model
Visible bool `gorm:"index"`
Title string
Description string
2024-01-05 03:50:33 +03:00
Tasks []*Task `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
2023-11-19 22:54:54 +03:00
Authors []*User `gorm:"many2many:game_authors"`
2024-01-05 03:50:33 +03:00
Type GameType
Points int
2024-01-20 21:37:49 +03:00
Icon *File
IconID uuid.UUID
2023-11-01 23:21:12 +03:00
}
2024-01-05 03:50:33 +03:00
type GameType int
2023-11-01 23:21:12 +03:00
const (
2024-01-05 03:50:33 +03:00
VirtualGame GameType = iota
CityGame
2023-11-01 23:21:12 +03:00
)