added subjects
This commit is contained in:
1 parent
62a2b64672
commit
3e40445b32
4 files changed
+33
-9
No files matched your search
+3
-1
@@ -5,6 +5,7 @@ mod error;
|
||||
mod events;
|
||||
mod homework;
|
||||
mod stdtype;
|
||||
mod subjects;
|
||||
mod user;
|
||||
|
||||
pub use absence::{Absence, AbsenceListItem, SubjectAbsence};
|
||||
@@ -14,4 +15,5 @@ pub use error::Error;
|
||||
pub use events::Events;
|
||||
pub use homework::{Homework, HomeworkListItem};
|
||||
pub use stdtype::StdType;
|
||||
pub use user::{Module, User};
|
||||
pub use user::{Module, User};
|
||||
pub use subjects::{Subject, Subjects};
|
||||
@@ -0,0 +1,23 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Subjects {
|
||||
pub subjects: Vec<Subject>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Subject {
|
||||
pub subject_id: String,
|
||||
pub subject_name: String,
|
||||
pub subject_abbrev: String,
|
||||
pub teacher_id: String,
|
||||
pub teacher_name: String,
|
||||
pub teacher_abbrev: String,
|
||||
pub teacher_email: String,
|
||||
pub teacher_web: String,
|
||||
// TeacherSchoolPhone:option<>,
|
||||
// TeacherHomePhone:option<>,
|
||||
// TeacherMobilePhone:option<>
|
||||
}
|
||||
+6
-7
@@ -4,8 +4,8 @@ use crate::StdType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct User{
|
||||
#[serde(rename="UserUID")]
|
||||
pub struct User {
|
||||
#[serde(rename = "UserUID")]
|
||||
pub user_uid: String,
|
||||
pub campaign_category_code: String,
|
||||
pub class: StdType,
|
||||
@@ -15,13 +15,12 @@ pub struct User{
|
||||
pub user_type: String,
|
||||
pub user_type_text: String,
|
||||
pub study_year: u8,
|
||||
pub enabled_modules: Vec<Module>
|
||||
//TODO: user SettingModules
|
||||
pub enabled_modules: Vec<Module>, //TODO: user SettingModules
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Module{
|
||||
pub struct Module {
|
||||
pub module: String,
|
||||
pub rights: Vec<String>
|
||||
}
|
||||
pub rights: Vec<String>,
|
||||
}
|
||||
Reference in new issue
Block a user