ms-tester/internal/models/contest.go
2025-03-29 00:36:23 +05:00

55 lines
1.2 KiB
Go

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"`
}
type ContestsListItem struct {
Id int32 `db:"id"`
Title string `db:"title"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ContestsList struct {
Contests []*ContestsListItem
Pagination Pagination
}
type ContestsFilter struct {
Page int32
PageSize int32
}
func (f ContestsFilter) Offset() int32 {
return (f.Page - 1) * f.PageSize
}
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"`
}