feat(tester): add endpoints

add GetMonitor&GetTask endpoints
This commit is contained in:
Vyacheslav1557 2025-03-28 01:17:53 +05:00
parent ef696d2836
commit b960a923d2
9 changed files with 400 additions and 16 deletions

View file

@ -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"`
}

View file

@ -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"`
}