resource

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 LoadResource

func LoadResource() gin.HandlerFunc

func RegisterRouter

func RegisterRouter(g *gin.RouterGroup)

Types

type Handler

type Handler struct {
}

func (*Handler) Download

func (*Handler) Download() gin.HandlerFunc

func (*Handler) List

func (*Handler) List() gin.HandlerFunc

func (*Handler) Modify

func (*Handler) Modify() gin.HandlerFunc

func (*Handler) SingleDelete

func (*Handler) SingleDelete() gin.HandlerFunc

func (*Handler) Upload

func (*Handler) Upload() gin.HandlerFunc

type ReqModify

type ReqModify struct {
	ExpiredAt    *time.Time `json:"expired_at"`
	IsHidden     *bool      `json:"is_hidden"`
	ContestID    *uint      `json:"contest_id"`
	ProblemAlias *string    `json:"problem_alias"`
}

func (*ReqModify) Bind

func (r *ReqModify) Bind(db *gorm.DB, session *cpt.Session, res *cpt.Resource) (err error)

type RespList

type RespList struct {
	Response
	Resources []*RespResource `json:"resources"`
}

type RespResource

type RespResource struct {
	UUID        string    `json:"uuid"`
	Name        string    `json:"name"`
	ContentType string    `json:"content_type"`
	ExpiredAt   time.Time `json:"expired_at"`
	IsHidden    bool      `json:"is_hidden"`
	ContestID   uint      `json:"contest_id"`
	ProblemID   uint      `json:"problem_id"`
	CreatedAt   time.Time `json:"created_at"`
}

func BindList

func BindList(resources []cpt.Resource) []*RespResource

func BindResource

func BindResource(res *cpt.Resource) *RespResource

type RespUpload

type RespUpload struct {
	Response
	UUID string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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