models

package
v0.0.0-...-f6b89fe Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UsernameError error
)

Functions

func CheckCollege

func CheckCollege(college string) bool

func CheckEmail

func CheckEmail(email string) bool

func CheckName

func CheckName(name string) bool

func CheckPassword

func CheckPassword(password string) bool

func CheckUserName

func CheckUserName(username string) bool

func Exec

func Exec(pid int, rawCode string, lang string, stdin string) Bridge.Code

Just run code used here. if stdin is nil, then sample input is used

func ExecBatch

func ExecBatch(pid int, rawcode string, lang string) []Bridge.TestCaseStatus

Types

type Contest

type Contest struct {
	Id          int `orm:"pk"`
	Name        string
	Description string
	StartTime   time.Time
	EndTime     time.Time
}

func (*Contest) Create

func (this *Contest) Create() (int64, bool)

func (*Contest) Delete

func (this *Contest) Delete() bool

func (*Contest) Edit

func (this *Contest) Edit() bool

func (*Contest) GetByName

func (this *Contest) GetByName() bool

type Contestlogs

type Contestlogs struct {
	Id     int `orm:"pk"`
	Uid    int
	Cid    int
	Points int
	Time   time.Time `orm:"auto_now_add;type(datetime)"`
}

func (*Contestlogs) Add

func (score *Contestlogs) Add() bool

func (*Contestlogs) GetByCid

func (score *Contestlogs) GetByCid() (*[]Contestlogs, bool)

func (*Contestlogs) GetByUidCid

func (score *Contestlogs) GetByUidCid() bool

func (*Contestlogs) Update

func (score *Contestlogs) Update() bool

type Problem

type Problem struct {
	Pid                  int `orm:"pk"`
	Uid                  int
	Statement            string
	Description          string
	Constraints          string
	Sample_input         string
	Sample_output        string
	Solution_description string `json:"-"`
	Solution_code        string `json:"-"`
	Type                 string
	Difficulty           string
	Created_at           time.Time `orm:"auto_now_add;type(datetime)"`
	Points               int
	Solve_count          int
}

func (*Problem) Create

func (problem *Problem) Create() (int, bool)

func (*Problem) DeleteByPid

func (problem *Problem) DeleteByPid() bool

func (*Problem) GetById

func (problem *Problem) GetById() bool

func (*Problem) GetByPid

func (problem *Problem) GetByPid() bool

func (*Problem) GetByStatement

func (problem *Problem) GetByStatement() bool

func (*Problem) GetByType

func (problem *Problem) GetByType(page int) ([]Problem, int64)

func (*Problem) GetByUid

func (problem *Problem) GetByUid() ([]Problem, int64)

func (*Problem) GetRecent

func (problem *Problem) GetRecent() ([]Problem, int64)

func (*Problem) GetSampleIOByPid

func (problem *Problem) GetSampleIOByPid() bool

func (*Problem) GetTypes

func (problem *Problem) GetTypes() (*orm.ParamsList, int64)

func (*Problem) Update

func (problem *Problem) Update() bool

type Problemlogs

type Problemlogs struct {
	Id     int `orm:"pk"`
	Pid    int
	Uid    int
	Solved int
	Points int
	Time   time.Time `orm:"auto_now_add;type(datetime)"`
}

func (*Problemlogs) CommitByPidUid

func (log *Problemlogs) CommitByPidUid() bool

func (*Problemlogs) GetByPidUid

func (log *Problemlogs) GetByPidUid() bool

func (*Problemlogs) GetByUid

func (log *Problemlogs) GetByUid() ([]Problemlogs, int64)

func (*Problemlogs) GetRecentByPid

func (log *Problemlogs) GetRecentByPid() ([]Problemlogs, int64)

func (*Problemlogs) Update

func (log *Problemlogs) Update() bool

type SubmitResponse

type SubmitResponse struct {
	Score  int
	Status []Bridge.TestCaseStatus
}

func SubmitUpdateScore

func SubmitUpdateScore(uid int, pid int, rawcode string, lang string) SubmitResponse

type Testcases

type Testcases struct {
	Id      int `orm:"pk"`
	Pid     int
	Tid     int
	Input   string
	Output  string
	Timeout int
}

func (*Testcases) Create

func (testcase *Testcases) Create() bool

func (*Testcases) DeleteAllByPid

func (testcase *Testcases) DeleteAllByPid() (int64, bool)

func (*Testcases) DeleteOneByPidTid

func (testcase *Testcases) DeleteOneByPidTid() bool

func (*Testcases) GetAllByPid

func (testcase *Testcases) GetAllByPid() ([]Testcases, int64)

func (*Testcases) GetOneByPidTid

func (testcase *Testcases) GetOneByPidTid() (Testcases, bool)

type User

type User struct {
	Uid       int `orm:"pk"`
	Username  string
	Password  string `json:"-"`
	Name      string
	College   string
	Email     string
	Score     int
	Rank      int
	Is_editor int `json:"-"`
}

func (*User) AddScore

func (user *User) AddScore(score int) bool

func (*User) ChangePassword

func (user *User) ChangePassword(password string) bool

func (*User) Create

func (user *User) Create() (int, bool)

func (*User) Delete

func (user *User) Delete() bool

func (*User) Get

func (user *User) Get() bool

func (*User) GetByUsername

func (user *User) GetByUsername() bool

func (*User) GetEditors

func (user *User) GetEditors() []User

func (*User) GetUserInfo

func (user *User) GetUserInfo() bool

func (*User) IsEditor

func (user *User) IsEditor() bool

func (*User) IsEmailUnique

func (user *User) IsEmailUnique() bool

func (*User) IsUsernameUnique

func (user *User) IsUsernameUnique() bool

func (*User) Login

func (user *User) Login() bool

func (*User) LoginVerify

func (user *User) LoginVerify() error

func (*User) MakeEditor

func (user *User) MakeEditor() bool

func (*User) RevokeEditor

func (user *User) RevokeEditor() bool

func (*User) SearchByName

func (user *User) SearchByName() ([]User, int64)

func (*User) SignupVerify

func (user *User) SignupVerify() error

func (*User) UpdateCollege

func (user *User) UpdateCollege(college string) bool

func (*User) UpdateRank

func (user *User) UpdateRank(rank int) bool

Jump to

Keyboard shortcuts

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