ms-tester/internal/models/testgroup.go
2024-08-18 18:41:08 +05:00

30 lines
564 B
Go

package models
import "time"
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 (TestingStrategy ts) Valid() error {
switch ts {
case EachTestTS, CompleteGroupTS:
return nil
}
return lib.ErrBadTestingStrategy
}