woj-server/internal/model/Problem.go
Paul Pan d42ee0ce54 feat: a big update
1. merge woj-runner scripts into woj-server
2. add woj-runner app
3. refactor submission status problem ...
4. jwt middleware update

Co-authored-by: cxy004 <cxy004@qq.com>
Co-authored-by: wzt <w.zhongtao@qq.com>
2022-10-22 17:38:39 +08:00

24 lines
731 B
Go

package model
import (
"github.com/jackc/pgtype"
"gorm.io/gorm"
)
type Problem struct {
gorm.Model `json:"meta"`
Title string `json:"title" gorm:"not null"`
Statement string `json:"statement" gorm:"not null"`
ProviderID uint `json:"-" gorm:"not null;index"`
Provider User `json:"provider" gorm:"foreignKey:ProviderID"`
IsEnabled bool `json:"is_enabled" gorm:"not null;index"`
}
type ProblemVersion struct {
gorm.Model `json:"meta"`
ProblemID uint `json:"-" gorm:"not null;index"`
Context pgtype.JSON `json:"context" gorm:"type:json"`
StorageKey string `json:"-" gorm:"not null"`
IsEnabled bool `json:"is_enabled" gorm:"not null;index"`
}