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:
35
internal/dto/schedule_converter.go
Normal file
35
internal/dto/schedule_converter.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user