Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MetaFieldsSelection = []string{"create_at", "update_at", "deleted_at"}
View Source
var ProblemInfoSelection = append([]string{"slug", "title"}, MetaFieldsSelection...)
View Source
var PublicUserSelection = append([]string{"account", "name"}, MetaFieldsSelection...)
Functions ¶
This section is empty.
Types ¶
type AlgorithmTag ¶
type AlgorithmTag struct { MetaFields Slug string `gorm:"primaryKey" json:"slug"` Name string `gorm:"not null" json:"name"` Problems []*Problem `gorm:"many2many:problem_algorithm_tags;" json:"problems,omitempty"` }
type CheckPoint ¶
type JudgeTask ¶
type JudgeTask struct { UID string `json:"uid"` ProblemSlug string `json:"problemSlug"` Src string `json:"src"` SrcLanguage string `json:"srcLanguage"` }
func NewJudgeTask ¶
type MetaFields ¶
type Problem ¶
type Problem struct { MetaFields Slug string `gorm:"primaryKey" json:"slug"` Title string `gorm:"not null" json:"title"` Description *string `gorm:"not null" json:"description,omitempty"` Tags []*AlgorithmTag `gorm:"many2many:problem_algorithm_tags;" json:"tags"` }
func (Problem) ToProblemInfo ¶
func (p Problem) ToProblemInfo() ProblemInfo
type ProblemInfo ¶
type ProblemInfo struct { MetaFields Slug string `json:"slug"` Title string `json:"title"` Tags []*AlgorithmTag `json:"tags"` }
type Role ¶
type Role struct { MetaFields Name string `gorm:"primaryKey" json:"name"` Users []*User `gorm:"many2many:user_roles" json:"users,omitempty"` }
type Submission ¶
type Submission struct { ID string `gorm:"primaryKey"` ProblemID string `gorm:"not null"` UserID string `gorm:"not null"` Language string `gorm:"not null"` Code string `gorm:"not null"` Status string `gorm:"not null"` Visibility bool `gorm:"not null"` CreateAt time.Time `gorm:"autoCreateTime"` UpdateAt time.Time `gorm:"autoUpdateTime"` }
type User ¶
type User struct { MetaFields Account string `gorm:"primaryKey" json:"account"` Name string `json:"name"` Password *string `gorm:"-:all" json:"password,omitempty"` HashedPassword string `gorm:"not null" json:"-"` Roles []*Role `gorm:"many2many:user_roles;" json:"roles,omitempty"` Email *string `gorm:"unique" json:"email,omitempty"` Mobile *string `gorm:"unique" json:"mobile,omitempty"` }
Click to show internal directories.
Click to hide internal directories.