feat(schedule): add academic system sync and course management improvements

- add educational system synchronization with username/password authentication
- implement long-press course deletion with single/all options
- add multi-lane course display for overlapping same-name courses
- refactor course detail screen with ScrollView and improved layout
- fix teacher display to show per-time-slot instructors instead of single field
- add settings modal with sync option and loading states
This commit is contained in:
2026-03-13 20:40:32 +08:00
parent 798dd7c9a0
commit e9d42fdb01
3 changed files with 391 additions and 44 deletions

View File

@@ -32,6 +32,19 @@ interface CreateScheduleCourseResponse {
course: ScheduleCourseDTO;
}
interface SyncScheduleRequest {
username: string;
password: string;
semester?: string;
}
interface SyncScheduleResponse {
success: boolean;
message: string;
synced_count: number;
error_message?: string;
}
const toCourse = (dto: ScheduleCourseDTO): Course => ({
id: dto.id,
name: dto.name,
@@ -64,7 +77,12 @@ class ScheduleService {
async deleteCourse(courseId: string): Promise<void> {
await api.delete(`/schedule/courses/${courseId}`);
}
async syncSchedule(req: SyncScheduleRequest): Promise<SyncScheduleResponse> {
const response = await api.post<SyncScheduleResponse>('/schedule/sync', req);
return response.data;
}
}
export const scheduleService = new ScheduleService();
export type { CreateScheduleCourseRequest };
export type { CreateScheduleCourseRequest, SyncScheduleRequest };