ms-tester/internal/models/testgroup.go

30 lines
564 B
Go
Raw Normal View History

2024-08-17 10:43:15 +00:00
package models
import "time"
type TestingStrategy int32
const (
EachTestTS TestingStrategy = 1;
CompleteGroupTS TestingStrategy = 2;
)
type Testgroup struct {
2024-08-18 13:41:08 +00:00
Id *int32 `db:"id"`
ProblemId *int32 `db:"problem_id"`
TestingStrategy *TestingStrategy `db:"testing_strategy"`
}
type TestgroupData struct {
Ts TestingStrategy
TestAmount int32
2024-08-17 10:43:15 +00:00
}
func (TestingStrategy ts) Valid() error {
switch ts {
case EachTestTS, CompleteGroupTS:
return nil
}
return lib.ErrBadTestingStrategy
}