added substitutions endpoints
This commit is contained in:
8 files changed
+60
-7
No files matched your search
+3
-5
@@ -1,6 +1,6 @@
|
||||
mod absence;
|
||||
mod api_info;
|
||||
mod attachment;
|
||||
mod others;
|
||||
//campaign
|
||||
mod auth;
|
||||
mod campaign;
|
||||
@@ -24,7 +24,6 @@ mod user; //TODOS
|
||||
//predictor
|
||||
|
||||
pub use absence::*;
|
||||
pub use api_info::ApiInfo;
|
||||
pub use attachment::AttachmentInfo;
|
||||
pub use auth::*;
|
||||
pub use campaign::Campaign;
|
||||
@@ -37,6 +36,7 @@ pub use gdpr::{
|
||||
};
|
||||
pub use homework::*;
|
||||
pub use marks::*;
|
||||
pub use others::*;
|
||||
pub use payments::*;
|
||||
pub use semester::{
|
||||
CertificateTerm, CertificateTerms, FinalMark, PedagogicalMeasure, PedagogicalMeasures,
|
||||
@@ -46,9 +46,7 @@ pub use stdtype::{
|
||||
Teacher, TeacherSet, TimetableStudent,
|
||||
};
|
||||
pub use subjects::*;
|
||||
pub use substitutions::{
|
||||
ChangeDisplayType, ChangeLessonInfo, SubstitutionChange, SubstitutionChangeType, Substitutions,
|
||||
};
|
||||
pub use substitutions::*;
|
||||
pub use teaching::*;
|
||||
pub use timetable::*;
|
||||
pub use user::*;
|
||||
File renamed without changes.
@@ -0,0 +1,15 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ApiInfo, Endpoint};
|
||||
|
||||
pub const API_V3_INFO_ENDPOINT: Endpoint<(), ApiInfo> = Endpoint::Get {
|
||||
url: "/api/3",
|
||||
auth: false,
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
pub const APIS_INFO_ENDPOINT: Endpoint<(), Vec<ApiInfo>> = Endpoint::Get {
|
||||
url: "/api",
|
||||
auth: false,
|
||||
_types: PhantomData,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
mod api_info;
|
||||
mod endpoints;
|
||||
|
||||
pub use api_info::*;
|
||||
pub use endpoints::*;
|
||||
@@ -0,0 +1,15 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, SubstitutionCycles, Substitutions};
|
||||
|
||||
pub const SUBSTITUTIONS_ENDPOINT: Endpoint<(), Substitutions> = Endpoint::Get {
|
||||
url: "/api/3/substitutions",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
pub const SUBSTITUTION_CYCLES_ENDPOINT: Endpoint<(), SubstitutionCycles> = Endpoint::Get {
|
||||
url: "/api/3/substitutions/cycles",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
mod endpoints;
|
||||
mod substitutions;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use substitutions::*;
|
||||
@@ -53,3 +53,18 @@ pub struct ChangeLessonInfo {
|
||||
subject_abbrev: Option<String>,
|
||||
room_abbrev: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct SubstitutionCycles {
|
||||
pub cycles_info: Option<Vec<DayCycleInfo>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct DayCycleInfo {
|
||||
pub date: DateTime<FixedOffset>,
|
||||
pub code: Option<String>,
|
||||
pub abbrev: Option<String>,
|
||||
pub name: Option<String>,
|
||||
}
|
||||
Reference in new issue
Block a user