contest

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadContest

func LoadContest() gin.HandlerFunc

func LoadNotification

func LoadNotification() gin.HandlerFunc

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) AdminAdd

func (*Handler) AdminAdd() gin.HandlerFunc

func (*Handler) AdminDelete

func (*Handler) AdminDelete() gin.HandlerFunc

func (*Handler) AdminList

func (*Handler) AdminList() gin.HandlerFunc

func (*Handler) Create

func (*Handler) Create() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) Modify

func (*Handler) Modify() gin.HandlerFunc

func (*Handler) NotificationCreate

func (*Handler) NotificationCreate() gin.HandlerFunc

func (*Handler) NotificationList

func (*Handler) NotificationList() gin.HandlerFunc

func (*Handler) NotificationSingleDelete

func (*Handler) NotificationSingleDelete() gin.HandlerFunc

func (*Handler) Show

func (*Handler) Show() gin.HandlerFunc

func (*Handler) SingleDelete

func (*Handler) SingleDelete() gin.HandlerFunc

func (*Handler) StatisticShow

func (*Handler) StatisticShow() gin.HandlerFunc

func (*Handler) TeamAdd

func (*Handler) TeamAdd() gin.HandlerFunc

func (*Handler) TeamCurrentLeave

func (*Handler) TeamCurrentLeave() gin.HandlerFunc

func (*Handler) TeamCurrentShow

func (*Handler) TeamCurrentShow() gin.HandlerFunc

func (*Handler) TeamDelete

func (*Handler) TeamDelete() gin.HandlerFunc

func (*Handler) TeamList

func (*Handler) TeamList() gin.HandlerFunc

type RNotification

type RNotification struct {
	Content       string    `json:"content"`
	PublishedTime time.Time `json:"published_time"`
}

func BindNotification

func BindNotification(n *cpt.ContestNotification) *RNotification

func BindNotificationList

func BindNotificationList(ns []cpt.ContestNotification) []*RNotification

type RStatisticSubmission

type RStatisticSubmission struct {
	TeamID       uint      `json:"team_id"`
	ProblemAlias string    `json:"problem_alias"`
	Points       uint      `json:"points"`
	SolvedTime   time.Time `json:"solved_time"`
}

type RStatisticTeam

type RStatisticTeam struct {
	ID             uint   `json:"id"`
	Name           string `json:"name"`
	Points         uint   `json:"points"`
	SolvedProblems uint   `json:"solved_problems"`
}

type RTeam

type RTeam struct {
	TeamID  uint              `json:"team_id"`
	Name    string            `json:"name"`
	Members []*team.RTeamUser `json:"members"`
}

func BindTeam

func BindTeam(db *gorm.DB, ts *cpt.TeamSnapshot) *RTeam

func BindTeamList

func BindTeamList(db *gorm.DB, snapshots []cpt.TeamSnapshot) []*RTeam

type RTeamSubmission

type RTeamSubmission struct {
	ProblemAlias string    `json:"problem_alias"`
	UserID       uint      `json:"user_id"`
	SolvedTime   time.Time `json:"solved_time"`
}

type ReqCreate

type ReqCreate struct {
	Name        string    `json:"name" validate:"max=50,min=1,required" binding:"max=50,min=1,required"`
	Description string    `json:"description"`
	StartTime   time.Time `json:"start_time" validate:"required" binding:"required"`
	EndTime     time.Time `json:"end_time" validate:"required" binding:"required"`
	Access      uint      `json:"access"`
}

type ReqModify

type ReqModify struct {
	Name        *string    `json:"name" validate:"omitempty,max=50,min=1" binding:"omitempty,max=50,min=1"`
	Description *string    `json:"description"`
	StartTime   *time.Time `json:"start_time"`
	EndTime     *time.Time `json:"end_time"`
	Access      *uint      `json:"access"`
	IsHidden    *bool      `json:"is_hidden"`
}

func (*ReqModify) Bind

func (r *ReqModify) Bind(c *cpt.Contest)

type ReqNotificationCreate

type ReqNotificationCreate struct {
	Content string `json:"content" validate:"required" binding:"required"`
}

type ReqTeamAdd

type ReqTeamAdd struct {
	TeamID    uint   `json:"team_id"`
	MembersID []uint `json:"members_id"`
}

type ReqTeamDelete

type ReqTeamDelete struct {
	TeamsID []uint `json:"teams_id"`
}

type RespContest

type RespContest struct {
	ID          uint      `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	StartTime   time.Time `json:"start_time"`
	EndTime     time.Time `json:"end_time"`
	Access      uint      `json:"access"`
	IsHidden    bool      `json:"is_hidden,omitempty"`
}

func BindContest

func BindContest(contest *cpt.Contest) *RespContest

func BindContestList

func BindContestList(db *gorm.DB, session *cpt.Session, contests []cpt.Contest) []*RespContest

type RespCreate

type RespCreate struct {
	Response
	ContestID uint `json:"contest_id,omitempty"`
}

type RespList

type RespList struct {
	Response
	Contests []*RespContest `json:"contests"`
}

type RespNotificationCreate

type RespNotificationCreate struct {
	Response
	NotificationOrder int `json:"notification_order"`
}

type RespNotificationList

type RespNotificationList struct {
	Response
	RequestTime   time.Time        `json:"request_time,omitempty"`
	Notifications []*RNotification `json:"notifications"`
}

type RespShow

type RespShow struct {
	Response
	Contest *RespContest `json:"contest,omitempty"`
}

type RespStatisticShow

type RespStatisticShow struct {
	Response
	Teams       []*RStatisticTeam       `json:"teams"`
	Submissions []*RStatisticSubmission `json:"submissions"`
}

type RespTeamCurrentShow

type RespTeamCurrentShow struct {
	Response
	Team        *RTeam             `json:"team,omitempty"`
	IsAdmin     bool               `json:"is_admin"`
	Submissions []*RTeamSubmission `json:"submissions,omitempty"`
}

type RespTeamDelete

type RespTeamDelete struct {
	Response
	Details []*RespTeamDeleteDetail `json:"details"`
}

type RespTeamDeleteDetail

type RespTeamDeleteDetail struct {
	Response
	TeamID uint `json:"team_id"`
}

type RespTeamList

type RespTeamList struct {
	Response
	Teams []*RTeam `json:"teams"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL