ms-tester/internal/models/testgroup.go
2024-08-21 03:54:46 +05:00

30 lines
583 B
Go

package models
import "git.sch9.ru/new_gate/ms-tester/internal/lib"
type TestingStrategy int32
const (
EachTestTS TestingStrategy = 1
CompleteGroupTS TestingStrategy = 2
)
type Testgroup struct {
Id *int32 `db:"id"`
ProblemId *int32 `db:"problem_id"`
TestingStrategy *TestingStrategy `db:"testing_strategy"`
}
type TestGroupData struct {
Ts TestingStrategy
TestAmount int32
}
func (ts TestingStrategy) Valid() error {
switch ts {
case EachTestTS, CompleteGroupTS:
return nil
}
return lib.ErrBadTestingStrategy
}