added event endpoints
This commit is contained in:
8 files changed
+37
-12
No files matched your search
@@ -33,3 +33,11 @@ pub struct SubjectAbsence {
|
||||
pub school: u16,
|
||||
pub distance_teaching: u16,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct SubjectAbsenceOverviewResponse {
|
||||
pub percentage_threshold: f64,
|
||||
pub absences: Option<Vec<AbsenceDay>>,
|
||||
pub absences_per_subject: Option<Vec<SubjectAbsence>>,
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, Events};
|
||||
|
||||
pub const EVENTS_ENDPOINT: Endpoint<Events, ()> = Endpoint::Get {
|
||||
url: "/api/3/events",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
pub const MY_EVENTS_ENDPOINT: Endpoint<Events, ()> = Endpoint::Get {
|
||||
url: "/api/3/events/my",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
@@ -2,8 +2,6 @@ use crate::{Room, RoomSet, SchoolClass, SchoolClassSet, StdType, Student, Teache
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// /api/3/events GET body response
|
||||
/// Get /api/3/events/my GET body response
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Events {
|
||||
@@ -1,5 +1,5 @@
|
||||
mod endpoints;
|
||||
mod homework;
|
||||
mod event;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use homework::*;
|
||||
pub use event::*;
|
||||
@@ -11,15 +11,14 @@ 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)
|
||||
pub const HOMEWORKS_ENDPOINT: Endpoint<(), HomeworkList> = Endpoint::Get {
|
||||
url: "api/3/homeworks",
|
||||
url: "api/3/homeworks",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
};
|
||||
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
mod endpoints;
|
||||
mod homeworks;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use homeworks::*;
|
||||
+4
-4
@@ -9,7 +9,7 @@ mod error;
|
||||
mod events;
|
||||
mod gdpr;
|
||||
//komens
|
||||
mod homeworks; //TDOS
|
||||
mod homework; //TDOS
|
||||
//marking
|
||||
mod marks;
|
||||
mod payments;
|
||||
@@ -23,19 +23,19 @@ mod user; //TODOS
|
||||
//webmodules
|
||||
//predictor
|
||||
|
||||
pub use absence::{AbsenceDay, StudentAbsenceOverviewResponse, SubjectAbsence};
|
||||
pub use absence::*;
|
||||
pub use api_info::ApiInfo;
|
||||
pub use attachment::AttachmentInfo;
|
||||
pub use auth::*;
|
||||
pub use campaign::Campaign;
|
||||
pub use endpoints::*;
|
||||
pub use error::{Error, ModelState, StringArray};
|
||||
pub use events::{Event, EventTime, EventType, Events};
|
||||
pub use events::*;
|
||||
pub use gdpr::{
|
||||
GdprCommissioner, GdprCommissioners, GdprConsent, GdprConsentRights, GdprConsentState,
|
||||
GdprValidity,
|
||||
};
|
||||
pub use homeworks::*;
|
||||
pub use homework::*;
|
||||
pub use marks::*;
|
||||
pub use payments::*;
|
||||
pub use semester::{
|
||||
|
||||
Reference in new issue
Block a user