nquest/pkg/models/game.go

21 lines
355 B
Go
Raw Normal View History

2023-11-01 23:21:12 +03:00
package models
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
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
)