problem

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProblem

func LoadProblem() gin.HandlerFunc

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

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) Show

func (*Handler) Show() gin.HandlerFunc

func (*Handler) SingleDelete

func (*Handler) SingleDelete() gin.HandlerFunc

func (*Handler) SubmissionCreate

func (*Handler) SubmissionCreate() gin.HandlerFunc

func (*Handler) TagAdd

func (*Handler) TagAdd() gin.HandlerFunc

func (*Handler) TagDelete

func (*Handler) TagDelete() gin.HandlerFunc

type RProblem

type RProblem struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Alias       string   `json:"alias"`
	ContestID   uint     `json:"contest_id"`
	Points      uint     `json:"points"`
	Type        string   `json:"type"`
	Tags        []string `json:"tags"`
	IsHidden    bool     `json:"is_hidden,omitempty"`
}

func BindList

func BindList(db *gorm.DB, session *cpt.Session, isContestAdmin bool, problems []cpt.Problem) []*RProblem

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"`
	Alias       string `json:"alias" validate:"max=50,min=1,alphanum,required" binding:"max=50,min=1,alphanum,required"`
	Points      uint   `json:"points"`
	Type        string `json:"type"`
}

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"`
	Points      *uint   `json:"points"`
	Type        *string `json:"type"`
	IsHidden    *bool   `json:"is_hidden"`
}

func (*ReqModify) Bind

func (r *ReqModify) Bind(p *cpt.Problem)

type ReqSubmissionCreate

type ReqSubmissionCreate struct {
	Flag string `json:"flag" validate:"required" binding:"required"`
}

type RespCreate

type RespCreate struct {
	Response
	ProblemAlias string `json:"problem_alias,omitempty"`
}

type RespList

type RespList struct {
	Response
	Problems []*RProblem `json:"problems"`
}

type RespShow

type RespShow struct {
	Response
	Problem *RProblem `json:"problem"`
}

type RespSubmissionCreate

type RespSubmissionCreate struct {
	Response
	Result uint `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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