Files
smartmate/backend/model/schedule.go
LoveLosita f554d9bd06 Version:0.0.4.dev.260203
feat: 📚 完成课程导入与校验接口(赶在 token 过期前…)

- 实现课程导入接口 
- 实现课程信息校验接口 🔍
- 测试通过 🧪

fix: 🐛 修了一堆 bug,15 分钟 accessToken 默默见证了时间的流逝 😭
2026-02-03 22:05:11 +08:00

32 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
type Schedule struct {
ID int `gorm:"primaryKey;autoIncrement" json:"id"`
UserID int `gorm:"column:user_id;index" json:"user_id"`
Type string `gorm:"type:enum('course','task');comment:'course / task'" json:"type"`
RelID int `gorm:"column:rel_id;comment:'关联 course_id 或 task_item_id'" json:"rel_id"`
CanBeEmbedded bool `gorm:"column:can_be_embedded;comment:'是否允许嵌入水课'" json:"can_be_embedded"`
EmbeddedTaskID *uint `gorm:"column:embedded_task_id;comment:'若为水课嵌入记录任务ID'" json:"embedded_task_id"`
Week int `gorm:"column:week" json:"week"`
DayOfWeek int `gorm:"column:day_of_week" json:"day_of_week"`
Sections string `gorm:"type:varchar(255)" json:"sections"`
Status string `gorm:"type:enum('normal','interrupted');default:'normal'" json:"status"`
}
type UserImportCoursesRequest struct {
Courses []UserCheckCourseRequest `json:"courses"`
}
type UserCheckCourseRequest struct {
CourseName string `json:"course_name"`
Location string `json:"location"`
IsAllowTasks bool `json:"is_allow_tasks"`
Arrangements []struct {
StartWeek int `json:"start_week"`
EndWeek int `json:"end_week"`
DayOfWeek int `json:"day_of_week"`
StartSection int `json:"start_section"`
EndSection int `json:"end_section"`
} `json:"arrangements"`
}