feat(schedule): add course table screens and navigation

Add complete schedule functionality including:
- Schedule screen with weekly course table view
- Course detail screen with transparent modal presentation
- New ScheduleStack navigator integrated into main tab bar
- Schedule service for API interactions
- Type definitions for course entities

Also includes bug fixes for group invite/request handlers
to include required groupId parameter.
This commit is contained in:
2026-03-12 08:38:14 +08:00
parent 21293644b8
commit 0a0cbacbcc
25 changed files with 3050 additions and 260 deletions

View File

@@ -0,0 +1,35 @@
package model
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
// ScheduleCourse 用户课表课程
type ScheduleCourse struct {
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
UserID string `json:"user_id" gorm:"type:varchar(36);index;not null"`
Name string `json:"name" gorm:"type:varchar(120);not null"`
Teacher string `json:"teacher" gorm:"type:varchar(80)"`
Location string `json:"location" gorm:"type:varchar(120)"`
DayOfWeek int `json:"day_of_week" gorm:"index;not null"` // 0=周一, 6=周日
StartSection int `json:"start_section" gorm:"not null"`
EndSection int `json:"end_section" gorm:"not null"`
Weeks string `json:"weeks" gorm:"type:text;not null"` // JSON 数组字符串
Color string `json:"color" gorm:"type:varchar(20)"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (s *ScheduleCourse) BeforeCreate(tx *gorm.DB) error {
if s.ID == "" {
s.ID = uuid.New().String()
}
return nil
}
func (ScheduleCourse) TableName() string {
return "schedule_courses"
}