feat: add solutions service
This commit is contained in:
parent
0fda91d8d5
commit
d9e2f46de8
6 changed files with 80 additions and 5 deletions
|
@ -7,7 +7,6 @@ type Solution struct {
|
|||
ParticipantId *int32 `db:"participant_id"`
|
||||
ProblemId *int32 `db:"problem_id"`
|
||||
LanguageId *int32 `db:"language_id"`
|
||||
ContestId *int32 `db:"contest_id"`
|
||||
SolutionHash *string `db:"solution_hash"`
|
||||
Result *int32 `db:"result"`
|
||||
CreatedAt *time.Time `db:"created_at"`
|
||||
|
|
24
internal/models/testgroup.go
Normal file
24
internal/models/testgroup.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
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 *int32 `db:"testing_strategy"`
|
||||
}
|
||||
|
||||
func (TestingStrategy ts) Valid() error {
|
||||
switch ts {
|
||||
case EachTestTS, CompleteGroupTS:
|
||||
return nil
|
||||
}
|
||||
return lib.ErrBadTestingStrategy
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue