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 dto
import (
"encoding/json"
"carrot_bbs/internal/model"
)
func ConvertScheduleCourseToResponse(course *model.ScheduleCourse, weeks []int) *ScheduleCourseResponse {
if course == nil {
return nil
}
return &ScheduleCourseResponse{
ID: course.ID,
Name: course.Name,
Teacher: course.Teacher,
Location: course.Location,
DayOfWeek: course.DayOfWeek,
StartSection: course.StartSection,
EndSection: course.EndSection,
Weeks: weeks,
Color: course.Color,
}
}
func ParseWeeksJSON(raw string) []int {
if raw == "" {
return []int{}
}
var weeks []int
if err := json.Unmarshal([]byte(raw), &weeks); err != nil {
return []int{}
}
return weeks
}

View File

@@ -0,0 +1,13 @@
package dto
type ScheduleCourseResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Teacher string `json:"teacher,omitempty"`
Location string `json:"location,omitempty"`
DayOfWeek int `json:"day_of_week"`
StartSection int `json:"start_section"`
EndSection int `json:"end_section"`
Weeks []int `json:"weeks"`
Color string `json:"color,omitempty"`
}