models

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDatabase

func ConnectDatabase(cfg *config.DBConfig) (*gorm.DB, error)

Types

type Contest

type Contest struct {
	gorm.Model

	EjudgeID           uint   `gorm:"unique;not null"`
	EjudgeName         string `gorm:"not null;type:varchar(128)"`
	EjudgeProblemsList string `gorm:"not null;type:varchar(128)"`

	ReviewActive bool `gorm:"not null;default:true"`
}

func NewContestFromEj

func NewContestFromEj(contest *ejudge.EjContest) *Contest

type Run

type Run struct {
	gorm.Model

	EjudgeID        uint   `gorm:"not null;uniqueIndex:idx_full_id"`
	EjudgeContestID uint   `gorm:"not null;uniqueIndex:idx_full_id"`
	EjudgeUserLogin string `gorm:"not null;type:varchar(128)"`
	EjudgeName      string `gorm:"not null;type:varchar(32)"`

	ReviewCount uint `gorm:"not null"`
	Rating      int  `gorm:"not null"`
}

func NewRunFromEj

func NewRunFromEj(run *ejudge.EjRun) *Run

type User

type User struct {
	gorm.Model

	EjudgeID       uint   `gorm:"not null"`
	EjudgeLogin    string `gorm:"unique;not null;type:varchar(128)"`
	EjudgePassword string `gorm:"not null;type:varchar(128)"`

	ReviewAproveCount uint `gorm:"not null"`
	ReviewRejectCount uint `gorm:"not null"`
}

TODO: set EjudgeID and hash password.

func NewUserFromForm

func NewUserFromForm(login, password string) *User

Jump to

Keyboard shortcuts

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