2023-11-01 23:21:12 +03:00
|
|
|
package models
|
|
|
|
|
2024-01-06 08:44:26 +03:00
|
|
|
import "github.com/google/uuid"
|
|
|
|
|
2023-11-01 23:21:12 +03:00
|
|
|
type Task struct {
|
|
|
|
Model
|
|
|
|
|
|
|
|
Title string
|
|
|
|
Text string
|
|
|
|
MaxTime int
|
2024-01-06 08:44:26 +03:00
|
|
|
GameID uuid.UUID
|
2023-11-01 23:21:12 +03:00
|
|
|
Solutions []*Solution `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
|
|
|
Codes []*Code `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
2024-01-06 08:44:26 +03:00
|
|
|
TaskOrder uint
|
2023-11-01 23:21:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type Solution struct {
|
|
|
|
Model
|
|
|
|
|
2024-01-06 08:44:26 +03:00
|
|
|
TaskID uuid.UUID
|
2023-11-01 23:21:12 +03:00
|
|
|
After int
|
|
|
|
Text string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Code struct {
|
|
|
|
Model
|
|
|
|
|
2024-01-06 08:44:26 +03:00
|
|
|
TaskID uuid.UUID
|
2023-11-01 23:21:12 +03:00
|
|
|
Code string `gorm:"index"`
|
|
|
|
Description string
|
|
|
|
}
|