From 01607db3e441474ba0b7f8ab003773b410b614f9 Mon Sep 17 00:00:00 2001 From: vextrixes <113197359+vextrixes@users.noreply.github.com> Date: Thu, 29 Oct 2026 18:07:19 +0100 Subject: [PATCH] added teaching endpoints --- src/homework/endpoints.rs | 4 ++-- src/lib.rs | 2 +- src/teaching/endpoints.rs | 10 ++++++++++ src/teaching/mod.rs | 5 +++++ src/{ => teaching}/teaching.rs | 0 tracker.md | 6 +++--- 6 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/teaching/endpoints.rs create mode 100644 src/teaching/mod.rs rename src/{ => teaching}/teaching.rs (100%) diff --git a/src/homework/endpoints.rs b/src/homework/endpoints.rs index 16619f7..ca3710f 100644 --- a/src/homework/endpoints.rs +++ b/src/homework/endpoints.rs @@ -11,12 +11,12 @@ pub const HOMEWORKS_COUNT_ENDPOINT: Endpoint<(), i64> = Endpoint::Get { /// ID = homework ID (String) /// finished = homework state (bool) pub const HOMEWORK_DONE_ENDPOINT: Endpoint<(), bool> = Endpoint::Get { - url: "api/3/homeworks/:id/student-done/:finished", + url: "api/3/homeworks/{id}/student-done/{finished}", auth: true, _types: PhantomData, }; -/// Query from and to (Datetime) +/// Query 'from' and 'to' (Datetime) pub const HOMEWORKS_ENDPOINT: Endpoint<(), HomeworkList> = Endpoint::Get { url: "api/3/homeworks", auth: true, diff --git a/src/lib.rs b/src/lib.rs index 8b7b3ab..c158512 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,6 +49,6 @@ pub use subjects::*; pub use substitutions::{ ChangeDisplayType, ChangeLessonInfo, SubstitutionChange, SubstitutionChangeType, Substitutions, }; -pub use teaching::{Lesson, Teaching, TeachingTheme}; +pub use teaching::*; pub use timetable::*; pub use user::*; diff --git a/src/teaching/endpoints.rs b/src/teaching/endpoints.rs new file mode 100644 index 0000000..3592e88 --- /dev/null +++ b/src/teaching/endpoints.rs @@ -0,0 +1,10 @@ +use std::marker::PhantomData; + +use crate::{Endpoint, Teaching}; + +/// Subject ID = String +pub const TEACHING_ENDPOINT: Endpoint<(), Teaching> = Endpoint::Get { + url: "/api/3/subjects/themes/{subjectId}", + auth: true, + _types: PhantomData, +}; diff --git a/src/teaching/mod.rs b/src/teaching/mod.rs new file mode 100644 index 0000000..9e0c119 --- /dev/null +++ b/src/teaching/mod.rs @@ -0,0 +1,5 @@ +mod endpoints; +mod teaching; + +pub use endpoints::*; +pub use teaching::*; diff --git a/src/teaching.rs b/src/teaching/teaching.rs similarity index 100% rename from src/teaching.rs rename to src/teaching/teaching.rs diff --git a/tracker.md b/tracker.md index 34248c2..f22119c 100644 --- a/tracker.md +++ b/tracker.md @@ -40,7 +40,7 @@ - [ ] /api/3/payments/classfund/teacher/document/detail/:documentId - [ ] /api/3 - [ ] /api/3/komens/attachment/:id -- [ ] /api/3/subjects/themes/:subjectId +- [x] /api/3/subjects/themes/:subjectId - [ ] /api/3/payments/classfund - [ ] /api/3/gdpr/consents/person/child - [ ] /api/3/komens/concept/:conceptId @@ -87,7 +87,7 @@ - [ ] /api/3/absence - [ ] /api/3/komens/message/:messageId/mark-as-confirmed - [ ] /api/3/komens/messages/apology -- [ ] /api/3/events +- [x] /api/3/events - [ ] /api/3/komens/concepts/count - [ ] /api/3/payments/regularpayments/teacher/prescriptions/:prescriptionId/students - [ ] /api/3/payments/regularpayments @@ -104,7 +104,7 @@ - [ ] /api/3/emergency/participantsselection - [ ] /api/3/komens/messages/noticeboard/unread - [ ] /api/3/komens/message-types -- [ ] /api/3/events/my +- [x] /api/3/events/my - [ ] /api/3/gdpr/commissioners - [ ] /api/3/classbook/:recordId - [ ] /api/3/marking/marks/:atomId