|
|
@ -3,7 +3,7 @@ package entity
|
|
|
|
import "online_code/common/types"
|
|
|
|
import "online_code/common/types"
|
|
|
|
|
|
|
|
|
|
|
|
// Problem 问题表
|
|
|
|
// Problem 问题表
|
|
|
|
type Problem struct {
|
|
|
|
type ProblemBasic struct {
|
|
|
|
types.BaseDbModel
|
|
|
|
types.BaseDbModel
|
|
|
|
Identity string `json:"identity" gorm:"column:identity;type:varchar(36);comment:'问题表的唯一标识'" ` // 问题表的唯一标识
|
|
|
|
Identity string `json:"identity" gorm:"column:identity;type:varchar(36);comment:'问题表的唯一标识'" ` // 问题表的唯一标识
|
|
|
|
ProblemCategories []*ProblemCategory `json:"problem_categories" gorm:"foreignKey:problem_id;references:id;comment:'关联问题分类表'" ` // 关联问题分类表
|
|
|
|
ProblemCategories []*ProblemCategory `json:"problem_categories" gorm:"foreignKey:problem_id;references:id;comment:'关联问题分类表'" ` // 关联问题分类表
|
|
|
@ -16,6 +16,6 @@ type Problem struct {
|
|
|
|
SubmitNum int64 `json:"submit_num" gorm:"column:submit_num;type:int(11);comment:'提交次数'" ` // 提交次数
|
|
|
|
SubmitNum int64 `json:"submit_num" gorm:"column:submit_num;type:int(11);comment:'提交次数'" ` // 提交次数
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (table *Problem) TableName() string {
|
|
|
|
func (table *ProblemBasic) TableName() string {
|
|
|
|
return "problem_basic"
|
|
|
|
return "problem_basic"
|
|
|
|
}
|
|
|
|
}
|