feat(tester): add endpoints
add GetMonitor&GetTask endpoints
This commit is contained in:
parent
ef696d2836
commit
b960a923d2
9 changed files with 400 additions and 16 deletions
|
@ -3,10 +3,10 @@ package models
|
|||
import "time"
|
||||
|
||||
type Contest struct {
|
||||
Id *int32 `db:"id"`
|
||||
Title *string `db:"title"`
|
||||
CreatedAt *time.Time `db:"created_at"`
|
||||
UpdatedAt *time.Time `db:"updated_at"`
|
||||
Id int32 `db:"id"`
|
||||
Title string `db:"title"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type ContestsListItem struct {
|
||||
|
@ -19,3 +19,23 @@ type ContestsListItem struct {
|
|||
type ContestUpdate struct {
|
||||
Title *string `json:"title"`
|
||||
}
|
||||
|
||||
type Monitor struct {
|
||||
Participants []*ParticipantsStat
|
||||
Summary []*ProblemStatSummary
|
||||
}
|
||||
|
||||
type ParticipantsStat struct {
|
||||
Id int32 `db:"id"`
|
||||
Name string `db:"name"`
|
||||
SolvedInTotal int32 `db:"solved_in_total"`
|
||||
PenaltyInTotal int32 `db:"penalty_in_total"`
|
||||
Solutions []*SolutionsListItem `db:"solutions"`
|
||||
}
|
||||
|
||||
type ProblemStatSummary struct {
|
||||
Id int32 `db:"task_id"`
|
||||
Position int32 `db:"position"`
|
||||
Success int32 `db:"success"`
|
||||
Total int32 `db:"total"`
|
||||
}
|
||||
|
|
|
@ -3,10 +3,21 @@ package models
|
|||
import "time"
|
||||
|
||||
type Task struct {
|
||||
Id int32 `db:"id"`
|
||||
ProblemId int32 `db:"problem_id"`
|
||||
ContestId int32 `db:"contest_id"`
|
||||
Position int32 `db:"position"`
|
||||
Id int32 `db:"id"`
|
||||
Position int32 `db:"position"`
|
||||
Title string `db:"title"`
|
||||
TimeLimit int32 `db:"time_limit"`
|
||||
MemoryLimit int32 `db:"memory_limit"`
|
||||
|
||||
ProblemId int32 `db:"problem_id"`
|
||||
ContestId int32 `db:"contest_id"`
|
||||
|
||||
LegendHtml string `db:"legend_html"`
|
||||
InputFormatHtml string `db:"input_format_html"`
|
||||
OutputFormatHtml string `db:"output_format_html"`
|
||||
NotesHtml string `db:"notes_html"`
|
||||
ScoringHtml string `db:"scoring_html"`
|
||||
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue