// =========================================== // 多班级版班级管理系统 - Go 后端 // // 开发者: Canglan // 联系方式: admin@sea-studio.top // 版权归属: Sea Network Technology Studio // 许可证: Apache License 2.0 // // 版权所有 © Sea Network Technology Studio // =========================================== package model import "time" // Subject 科目模型,对应 subjects 表 type Subject struct { SubjectID int `gorm:"column:subject_id;primaryKey;autoIncrement" json:"subject_id"` SubjectName string `gorm:"column:subject_name;type:varchar(50);uniqueIndex:uk_subject_name;not null" json:"subject_name"` SubjectCode *string `gorm:"column:subject_code;type:varchar(20)" json:"subject_code"` IsActive int8 `gorm:"column:is_active;default:1" json:"is_active"` SortOrder int `gorm:"column:sort_order;default:0" json:"sort_order"` CreatedAt time.Time `gorm:"column:created_at;autoCreateTime" json:"created_at"` } // TableName 指定表名 func (Subject) TableName() string { return "subjects" }