srv

package
v0.0.0-...-c89a2db Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: MIT Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ContestInvitePrefix = "contest_invite_"
)
View Source
const (
	GroupInvitePrefix = "group_invite_"
)

Variables

This section is empty.

Functions

func AddCatalog

func AddCatalog(c *gin.Context, newCatalog *model.Catalog) error

func AddContest

func AddContest(c *gin.Context, newContest *model.Contest) error

func AddGroup

func AddGroup(c *gin.Context, newGroup *model.Group) error

func AddProblem

func AddProblem(c *gin.Context, newProblem *model.Problem) error

func AddTag

func AddTag(c *gin.Context, newTag *model.Tag) error

func CheckPermission

func CheckPermission(c *gin.Context, groups []int, anyOne bool) error

check if user have these group Permission

func Comment4Problem

func Comment4Problem(c *gin.Context, commentArg *data.CommentArg) (*model.Comment, error)

func DeleteCatalog

func DeleteCatalog(c *gin.Context, id int) error

func DeleteTag

func DeleteTag(c *gin.Context, id int) error

func GetAllCatalogs

func GetAllCatalogs(c *gin.Context, page, pageSize int, order string) ([]model.Catalog, error)

func GetAllContests

func GetAllContests(c *gin.Context, page, pageSize int, order string) ([]model.Contest, error)

func GetAllGroups

func GetAllGroups(c *gin.Context, page, pageSize int, order string) ([]model.Group, error)

func GetAllProblems

func GetAllProblems(c *gin.Context, page, pageSize int, order string, of string, id int) ([]model.Problem, error)

func GetAllProblemsOf

func GetAllProblemsOf(c *gin.Context) *gorm.DB

func GetAllProblemsOfContest

func GetAllProblemsOfContest(c *gin.Context, id int) (*gorm.DB, error)

func GetAllProblemsOfGroup

func GetAllProblemsOfGroup(c *gin.Context, id int) (*gorm.DB, error)

func GetAllProblemsOfTag

func GetAllProblemsOfTag(c *gin.Context, id int) *gorm.DB

func GetAllSubmit

func GetAllSubmit(c *gin.Context, page, pageSize int, order string, of string, id int, onlyDuringContest bool) ([]model.Submit, error)

func GetAllSubmitOfContest

func GetAllSubmitOfContest(c *gin.Context, id int, onlyDuringContest bool) (*gorm.DB, error)

func GetAllSubmitOfGroup

func GetAllSubmitOfGroup(c *gin.Context, id int) (*gorm.DB, error)

func GetAllSubmitOfMe

func GetAllSubmitOfMe(c *gin.Context) (*gorm.DB, error)

func GetAllSubmitOfProblem

func GetAllSubmitOfProblem(c *gin.Context, id int) (*gorm.DB, error)

func GetAllSubmitOfUser

func GetAllSubmitOfUser(c *gin.Context, id int) (*gorm.DB, error)

func GetAllTags

func GetAllTags(c *gin.Context) ([]model.Tag, error)

func GetAllTemplates

func GetAllTemplates(c *gin.Context) ([]model.Template, error)

func GetCatalog

func GetCatalog(c *gin.Context, id int) (*model.Catalog, error)

func GetContest

func GetContest(c *gin.Context, id int) (*model.Contest, error)

func GetContestInviteData

func GetContestInviteData(c *gin.Context, inviteId string) (*data.ContestInviteData, error)

func GetContestInviteInfo

func GetContestInviteInfo(c *gin.Context, contestID int) (*data.ContestInviteData, error)

func GetGroup

func GetGroup(c *gin.Context, id int) (*model.Group, error)

func GetGroupInviteData

func GetGroupInviteData(c *gin.Context, inviteId string) (*data.GroupInviteData, error)

return value:

func GetGroupInviteInfo

func GetGroupInviteInfo(c *gin.Context, groupID int) (*data.GroupInviteData, error)

func GetLastSubmit

func GetLastSubmit(c *gin.Context, id int, needSuccess bool, needComplete bool) (*model.Submit, error)

get last submit, is set success flag, return lease successful submit

func GetProblem

func GetProblem(c *gin.Context, id int, forUpdate bool) (*model.Problem, error)

func GetResult

func GetResult(c *gin.Context, problemID int) (*judge.OuterResult, error)

get result

func GetSubmit

func GetSubmit(c *gin.Context, id int) (*model.Submit, error)

func GetTag

func GetTag(c *gin.Context, id int) (*model.Tag, error)

func Invite2Contest

func Invite2Contest(c *gin.Context, inviteData *data.ContestInviteData) (err error)

func Invite2Group

func Invite2Group(c *gin.Context, inviteData *data.GroupInviteData) (err error)

func JoinContest

func JoinContest(c *gin.Context, inviteId string, password string) (err error)

func JoinContestQuery

func JoinContestQuery(c *gin.Context, inviteId string) (*data.ContestWrap, error)

query before join

func JoinGroup

func JoinGroup(c *gin.Context, inviteId string, password string) (err error)

func JoinGroupQuery

func JoinGroupQuery(c *gin.Context, inviteId string) (*data.GroupWrap, error)

query before join

func SaveTheme

func SaveTheme(c *gin.Context, theme *model.Theme) error

func Submit

func Submit(c *gin.Context, submitArg *data.SubmitArg) error

submit answer

func UpdateCatalog

func UpdateCatalog(c *gin.Context, newCatalog *model.Catalog) error

func UpdateContest

func UpdateContest(c *gin.Context, newContest *model.Contest) error

func UpdateGroup

func UpdateGroup(c *gin.Context, newGroup *model.Group) error

func UpdateProblem

func UpdateProblem(c *gin.Context, newProblem *model.Problem) error

func UpdateTag

func UpdateTag(c *gin.Context, newTag *model.Tag) error

func VoteProblem

func VoteProblem(c *gin.Context, id int, attitude int) error

vote for problem

Types

This section is empty.

Jump to

Keyboard shortcuts

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