2022-09-20 16:42:57 +08:00
|
|
|
package model
|
|
|
|
|
2022-10-04 15:31:07 +08:00
|
|
|
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"`
|
2022-10-04 15:31:07 +08:00
|
|
|
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"`
|
2022-10-04 15:31:07 +08:00
|
|
|
IsEnabled bool `json:"is_enabled" gorm:"not null;index"`
|
2022-09-20 16:42:57 +08:00
|
|
|
}
|