From 62a2b6467224d4082d84fc94b9396062bed89bc8 Mon Sep 17 00:00:00 2001 From: vextrixes <113197359+vextrixes@users.noreply.github.com> Date: Sun, 25 Oct 2026 11:02:35 +0100 Subject: [PATCH] added user --- src/lib.rs | 2 ++ src/user.rs | 27 +++++++++++++++++++++++++++ tracker.md | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/user.rs diff --git a/src/lib.rs b/src/lib.rs index 4ef6db7..ac01b41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ mod error; mod events; mod homework; mod stdtype; +mod user; pub use absence::{Absence, AbsenceListItem, SubjectAbsence}; pub use api_info::ApiInfo; @@ -13,3 +14,4 @@ pub use error::Error; pub use events::Events; pub use homework::{Homework, HomeworkListItem}; pub use stdtype::StdType; +pub use user::{Module, User}; \ No newline at end of file diff --git a/src/user.rs b/src/user.rs new file mode 100644 index 0000000..c3d2f9e --- /dev/null +++ b/src/user.rs @@ -0,0 +1,27 @@ +use serde::{Deserialize, Serialize}; + +use crate::StdType; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct User{ + #[serde(rename="UserUID")] + pub user_uid: String, + pub campaign_category_code: String, + pub class: StdType, + pub full_name: String, + pub school_organization_name: String, + pub school_type: Option, + pub user_type: String, + pub user_type_text: String, + pub study_year: u8, + pub enabled_modules: Vec + //TODO: user SettingModules +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct Module{ + pub module: String, + pub rights: Vec +} \ No newline at end of file diff --git a/tracker.md b/tracker.md index da02ead..a2da4f2 100644 --- a/tracker.md +++ b/tracker.md @@ -14,6 +14,7 @@ - [ ] substitutions - [ ] themes - [ ] timetable -- [ ] user +- [x] user +- [ ] user SettingModules - [ ] web - [ ] what if \ No newline at end of file