25 lines
1.3 KiB
Go
25 lines
1.3 KiB
Go
package learning
|
|
|
|
import (
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
|
)
|
|
|
|
// Course 课程模型
|
|
type Course struct {
|
|
global.GVA_MODEL
|
|
Title string `json:"title" form:"title" gorm:"column:title;comment:课程标题;size:255;not null;" binding:"required"`
|
|
Description string `json:"description" form:"description" gorm:"column:description;comment:课程描述;type:longtext;"`
|
|
Cover string `json:"cover" form:"cover" gorm:"column:cover;comment:课程封面图片URL;size:500;"`
|
|
Difficulty string `json:"difficulty" form:"difficulty" gorm:"column:difficulty;comment:难度等级;size:50;default:beginner;"`
|
|
Duration int `json:"duration" form:"duration" gorm:"column:duration;comment:预计学时(分钟);default:0;"`
|
|
Status string `json:"status" form:"status" gorm:"column:status;comment:课程状态;size:50;default:draft;"`
|
|
Price float64 `json:"price" form:"price" gorm:"column:price;comment:课程价格;type:decimal(10,2);default:0.00;"`
|
|
Tags string `json:"tags" form:"tags" gorm:"column:tags;comment:课程标签,逗号分隔;size:500;"`
|
|
Sort int `json:"sort" form:"sort" gorm:"column:sort;comment:排序权重;default:0;"`
|
|
}
|
|
|
|
// TableName 设置表名
|
|
func (Course) TableName() string {
|
|
return "learning_courses"
|
|
}
|