woj-server/internal/model/Problem.go

21 lines
794 B
Go
Raw Normal View History

2022-09-20 16:42:57 +08:00
package model
import (
"github.com/lib/pq"
"gorm.io/gorm"
)
2022-09-20 16:42:57 +08:00
type Problem struct {
2022-09-26 16:13:31 +08:00
gorm.Model `json:"meta"`
Title string `json:"title" gorm:"not null"`
Content string `json:"content" gorm:"not null"`
TimeLimit uint `json:"time_limit" gorm:"not null"`
MemoryLimit uint `json:"memory_limit" gorm:"not null"`
ProviderID uint `json:"provider_id" gorm:"not null;index"`
Provider User `json:"-" gorm:"foreignKey:ProviderID"`
Languages pq.Int32Array `json:"languages" gorm:"type:int[]"`
Points pq.Int32Array `json:"points" gorm:"type:int[]"`
2022-10-13 16:32:44 +08:00
StorageKey string `json:"storage_key" gorm:"not null"`
IsEnabled bool `json:"is_enabled" gorm:"not null;index"`
2022-09-20 16:42:57 +08:00
}