nquest/pkg/models/task.go

26 lines
444 B
Go
Raw Permalink Normal View History

2023-11-01 23:21:12 +03:00
package models
2024-01-28 22:19:41 +03:00
import (
"github.com/google/uuid"
)
2023-11-01 23:21:12 +03:00
type Task struct {
2024-01-28 22:19:41 +03:00
ID uuid.UUID `gorm:"primarykey" json:"id"`
2023-11-01 23:21:12 +03:00
Title string
Text string
MaxTime int
2024-05-05 19:42:33 +03:00
Game *Game
GameID uuid.UUID
2024-01-28 22:19:41 +03:00
Codes []*Code `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
TaskOrder uint
2023-11-01 23:21:12 +03:00
}
type Code struct {
2024-01-28 22:19:41 +03:00
ID uuid.UUID `gorm:"primarykey" json:"id"`
2023-11-01 23:21:12 +03:00
TaskID uuid.UUID
2023-11-01 23:21:12 +03:00
Code string `gorm:"index"`
Description string
}