controllers

package
v0.0.0-...-7986dfc Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DOWN_DIR = "./static/down/"
View Source
const SESSION_USER_KEY = "JOE"

Variables

View Source
var CPT = captcha.NewWithFilter("/captcha/", store)
View Source
var OJ_DATA = "/home/judge/data"
View Source
var OJ_ZIP_TEMP_DATA = OJ_DATA + "/tempzip"
View Source
var USERROLE = []int{0, 1, 2}

Functions

func IsNil

func IsNil(i interface{}) bool

func PageCal

func PageCal(totalNum int64, pageNo int32, pageSize int) (bool, int32, int32)

func PageRangeCal

func PageRangeCal(totalNum int64, pageNo int32, pageSize int) (bool, []int, int32, int32)

Types

type BaseController

type BaseController struct {
	beego.Controller
	User      models.Users
	IsLogin   bool
	IsAdmin   bool
	IsTeacher bool
	AvatarURL string
}

func (*BaseController) Abort401

func (this *BaseController) Abort401(err error)

func (*BaseController) Abort404

func (this *BaseController) Abort404(err error)

func (*BaseController) Abort500

func (this *BaseController) Abort500(err error)

func (*BaseController) FilterSource

func (this *BaseController) FilterSource(key, msg string) (string, int)

* 过滤代码

func (*BaseController) GetMushString

func (this *BaseController) GetMushString(key, msg string) string

func (*BaseController) GetRegUserString

func (this *BaseController) GetRegUserString(key, msg string) string

func (*BaseController) JsonErr

func (this *BaseController) JsonErr(msg string, code int32, action string)

func (*BaseController) JsonOK

func (this *BaseController) JsonOK(msg, action string)

func (*BaseController) JsonOKH

func (this *BaseController) JsonOKH(msg string, data MAP_H)

func (*BaseController) MustLogin

func (this *BaseController) MustLogin()

func (*BaseController) Prepare

func (this *BaseController) Prepare()

type BlogController

type BlogController struct {
	BaseController
}

func (*BlogController) BlogAddGet

func (this *BlogController) BlogAddGet()

@router /admin/art/add [get]

func (*BlogController) BlogAddPost

func (this *BlogController) BlogAddPost()

@router /admin/art/add [post]

func (*BlogController) BlogIndex

func (this *BlogController) BlogIndex()

@router /article/:artid [get]

func (*BlogController) BlogList

func (this *BlogController) BlogList()

@router /admin/art/list [get]

type CPProblem

type CPProblem struct {
	ProId  int32
	Flag   bool
	ACtime float64
	ErrNum int64
}

type CR

type CR []*ContestRank

func (CR) Len

func (I CR) Len() int

func (CR) Less

func (I CR) Less(i, j int) bool

func (CR) Swap

func (I CR) Swap(i, j int)

type CeinfoController

type CeinfoController struct {
	BaseController
}

func (*CeinfoController) Ceinfo

func (this *CeinfoController) Ceinfo()

@router /ceinfo/:sid [get]

func (*CeinfoController) CeinfoContest

func (this *CeinfoController) CeinfoContest()

@router /contest/ceinfo/:sid [get]

type ContestController

type ContestController struct {
	BaseController
	Visible bool
}

func (*ContestController) ContestAddGet

func (this *ContestController) ContestAddGet()

@router /contest/add [get]

func (*ContestController) ContestAddPost

func (this *ContestController) ContestAddPost()

@router /contest/add [post]

func (*ContestController) ContestCid

func (this *ContestController) ContestCid()

@router /contest/cid/:id [get]

func (*ContestController) ContestList

func (this *ContestController) ContestList()

@router /contest/list [get]

func (*ContestController) ContestListPage

func (this *ContestController) ContestListPage()

@router /contest/list/:page [get]

func (*ContestController) ContestPage

func (this *ContestController) ContestPage()

@router /contest/:page [get]

func (*ContestController) ContestRank

func (this *ContestController) ContestRank()

@router /contestrank/cid/:cid [get]

func (*ContestController) ContestStatus

func (this *ContestController) ContestStatus()

@router /contest/status/cid/:cid [get]

func (*ContestController) ContestStatusPage

func (this *ContestController) ContestStatusPage()

@router /contest/status/cid/:cid/:page [get]

func (*ContestController) ContestUpdatePost

func (this *ContestController) ContestUpdatePost()

@router /contest/update [post]

func (*ContestController) ContestUpdateStatus

func (this *ContestController) ContestUpdateStatus()

@router /contest/updatestatus [post]

type ContestProblem

type ContestProblem struct {
	ProblemKey string
	ProId      int32
}

type ContestRank

type ContestRank struct {
	Rank      int
	Nick      string
	UserId    int32
	AC        int32
	Total     int32
	TotalTime float64
	CP        []CPProblem
}

type ContestSolution

type ContestSolution struct {
	ProblemKey string
	models.Solution
}

type ErrorController

type ErrorController struct {
	beego.Controller
}

func (*ErrorController) Error401

func (c *ErrorController) Error401()

func (*ErrorController) Error404

func (c *ErrorController) Error404()

func (*ErrorController) Error500

func (c *ErrorController) Error500()

func (*ErrorController) ErrorDb

func (c *ErrorController) ErrorDb()

type IndexController

type IndexController struct {
	BaseController
}

func (*IndexController) ContestUpdate

func (this *IndexController) ContestUpdate()

@router /contest/update/:cid [get]

func (*IndexController) Index

func (this *IndexController) Index()

@router /index [get]

func (*IndexController) IndexAdmin

func (this *IndexController) IndexAdmin()

@router /admin [get]

func (*IndexController) IndexContest

func (this *IndexController) IndexContest()

@router /contest [get]

func (*IndexController) IndexFaqs

func (this *IndexController) IndexFaqs()

@router /faqs [get]

func (*IndexController) IndexProblemset

func (this *IndexController) IndexProblemset()

@router /problemset [get]

func (*IndexController) IndexReg

func (this *IndexController) IndexReg()

@router /reg [get]

func (*IndexController) IndexStatus

func (this *IndexController) IndexStatus()

@router /status [get]

func (*IndexController) IndexUser

func (this *IndexController) IndexUser()

@router /login [get]

func (*IndexController) Indexs

func (this *IndexController) Indexs()

@router / [get]

type MAP_H

type MAP_H = map[string]interface{}

type Pro

type Pro struct {
	ProblemKey string
	ProblemId  int32
	Title      string
	Accepted   int32
	Submit     int32
	Solved     int32
	Cid        int32
}

type ProUser

type ProUser struct {
	Pid    int32
	Title  string
	Time   int32
	Memory int32
}

type ProblemController

type ProblemController struct {
	BaseController
}

func (*ProblemController) DownloadTestData

func (this *ProblemController) DownloadTestData()

@router /download/testdata [post]

func (*ProblemController) ExInport

func (this *ProblemController) ExInport()

@router /problem/exinport [get]

func (*ProblemController) Export

func (this *ProblemController) Export()

@router /problem/export [post]

func (*ProblemController) Fileupload

func (this *ProblemController) Fileupload()

@router /problem/fileupload [post]

func (*ProblemController) Inport

func (this *ProblemController) Inport()

@router /problem/inport [post]

func (*ProblemController) Problem

func (this *ProblemController) Problem()

@router /problem/:id [get]

func (*ProblemController) ProblemAdd

func (this *ProblemController) ProblemAdd()

@router /problem/add [get]

func (*ProblemController) ProblemAddPost

func (this *ProblemController) ProblemAddPost()

@router /problem/add [post]

func (*ProblemController) ProblemContest

func (this *ProblemController) ProblemContest()

@router /contest/problem/:id/:cid [get]

func (*ProblemController) ProblemDel

func (this *ProblemController) ProblemDel()

@router /problem/del [post]

func (*ProblemController) ProblemEdit

func (this *ProblemController) ProblemEdit()

@router /problem/edit/:id [get]

func (*ProblemController) ProblemList

func (this *ProblemController) ProblemList()

@router /problem/list [get]

func (*ProblemController) ProblemListPage

func (this *ProblemController) ProblemListPage()

@router /problem/list/:page [get]

func (*ProblemController) ProblemSetPage

func (this *ProblemController) ProblemSetPage()

@router /problemset/:page [get]

func (*ProblemController) ProblemTestDataEdit

func (this *ProblemController) ProblemTestDataEdit()

@router /problem/editdata/:pid [get]

func (*ProblemController) ProblemUpdate

func (this *ProblemController) ProblemUpdate()

@router /problem/update [post]

func (*ProblemController) ProblemUpdateStatus

func (this *ProblemController) ProblemUpdateStatus()

@router /problem/updatestatus [post]

func (*ProblemController) Rejudge

func (this *ProblemController) Rejudge()

@router /admin/rejudge [get]

func (*ProblemController) RejudgePost

func (this *ProblemController) RejudgePost()

@router /admin/rejudge [post]

func (*ProblemController) Upload

func (this *ProblemController) Upload()

@router /upload/fileupload/:pid [post]

type Problems

type Problems struct {
	// contains filtered or unexported fields
}

type RankUsers

type RankUsers struct {
	Rank int
	models.Users
}

type SolutionController

type SolutionController struct {
	BaseController
}

func (*SolutionController) StatusPage

func (this *SolutionController) StatusPage()

@router /status/:page [get]

func (*SolutionController) Submit

func (this *SolutionController) Submit()

@router /submit [post]

type SortUser

type SortUser []*models.Users

func (SortUser) Len

func (I SortUser) Len() int

func (SortUser) Less

func (I SortUser) Less(i, j int) bool

func (SortUser) Swap

func (I SortUser) Swap(i, j int)

type UserController

type UserController struct {
	BaseController
}

func (*UserController) ChangePassword

func (this *UserController) ChangePassword()

@router /admin/changepwd [get]

func (*UserController) ChangePwd

func (this *UserController) ChangePwd()

@router /admin/changepwd [post]

func (*UserController) Login

func (this *UserController) Login()

@router /login [post]

func (*UserController) Logout

func (this *UserController) Logout()

@router /logout [get]

func (*UserController) PermissionsAdd

func (this *UserController) PermissionsAdd()

@router /admin/permissions/add [get]

func (*UserController) PermissionsAddPost

func (this *UserController) PermissionsAddPost()

@router /admin/permissions/add [post]

func (*UserController) PermissionsList

func (this *UserController) PermissionsList()

@router /admin/permissions/list [get]

func (*UserController) Profile

func (this *UserController) Profile()

@router /profile [get]

func (*UserController) Profile2

func (this *UserController) Profile2()

@router /profile/:uid [get]

func (*UserController) SendEmailForgot

func (this *UserController) SendEmailForgot()

@router /forgotpwd/sendemail [post]

func (*UserController) UserForgotPwd

func (this *UserController) UserForgotPwd()

@router /forgotpwd [get]

func (*UserController) UserGen

func (this *UserController) UserGen()

@router /admin/user/generate [get]

func (*UserController) UserGenPost

func (this *UserController) UserGenPost()

@router /admin/user/generate [post]

func (*UserController) UserList

func (this *UserController) UserList()

@router /user/list [get]

func (*UserController) UserListPage

func (this *UserController) UserListPage()

@router /user/list/:page [get]

func (*UserController) UserReg

func (this *UserController) UserReg()

@router /user/reg [post]

func (*UserController) UserUpdateGet

func (this *UserController) UserUpdateGet()

@router /profile/update [get]

func (*UserController) UserUpdatePost

func (this *UserController) UserUpdatePost()

@router /profile/update [post]

Jump to

Keyboard shortcuts

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