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

41 lines
859 B
Go

package models
import "time"
type Participant struct {
Id int32 `db:"id"`
UserId int32 `db:"user_id"`
ContestId int32 `db:"contest_id"`
Name string `db:"name"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ParticipantsListItem struct {
Id int32 `db:"id"`
UserId int32 `db:"user_id"`
ContestId int32 `db:"contest_id"`
Name string `db:"name"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
type ParticipantsList struct {
Participants []*ParticipantsListItem
Pagination Pagination
}
type ParticipantsFilter struct {
Page int32
PageSize int32
ContestId int32
}
func (f ParticipantsFilter) Offset() int32 {
return (f.Page - 1) * f.PageSize
}
type ParticipantUpdate struct {
Name *string `json:"name"`
}