small refactors
This commit is contained in:
38 files changed
+213
-244
No files matched your search
+4
-16
@@ -1,11 +1,10 @@
|
||||
use crate::{Hour, StdType, StdTypeNullable};
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{Hour, StdType, StdTypeNullable};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct StudentAbsenceOverviewResponse {
|
||||
pub struct AbsenceOverviewResponse {
|
||||
pub percentage_threshold: f64, //TODO: cutom type (u8)
|
||||
pub absences: Vec<AbsenceDay>,
|
||||
pub absences_per_subject: Option<Vec<SubjectAbsence>>,
|
||||
@@ -36,18 +35,10 @@ pub struct SubjectAbsence {
|
||||
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>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct StudentTimetableAbsenceResponse {
|
||||
pub student: Option<StudentInfo>,
|
||||
pub student: Option<StdTypeNullable>,
|
||||
pub days: Vec<AbsenceDayResponse>,
|
||||
pub absent_type_options: Vec<AbsenceTypeOption>,
|
||||
}
|
||||
@@ -60,7 +51,7 @@ pub struct AbsenceTypeOption {
|
||||
pub absent_kind_required: bool,
|
||||
pub absent_note_enabled: bool,
|
||||
pub next_absent_type: AbsentType,
|
||||
pub absent_kinds: Vec<AbsenceKind>,
|
||||
pub absent_kinds: Vec<StdType>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -76,9 +67,6 @@ pub enum AbsentType {
|
||||
NoAbsent,
|
||||
}
|
||||
|
||||
type StudentInfo = StdTypeNullable;
|
||||
type AbsenceKind = StdType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct AbsenceSubject {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
ContentType, Endpoint, ExcuseAbsenceResponse, StudentAbsenceOverviewResponse,
|
||||
AbsenceOverviewResponse, ContentType, Endpoint, ExcuseAbsenceResponse,
|
||||
StudentTimetableAbsenceResponse,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const CAN_STUDENT_EXCUSE_ABSENCE_ENDPOINT: Endpoint<bool, ()> = Endpoint::Get {
|
||||
url: "/api/3/absence/canexcuse/{studentId}",
|
||||
@@ -11,12 +10,11 @@ pub const CAN_STUDENT_EXCUSE_ABSENCE_ENDPOINT: Endpoint<bool, ()> = Endpoint::Ge
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
pub const GET_STUDENT_ABSENCE_ENDPOINT: Endpoint<StudentAbsenceOverviewResponse, ()> =
|
||||
Endpoint::Get {
|
||||
url: "/api/3/absence/student",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
pub const GET_STUDENT_ABSENCE_ENDPOINT: Endpoint<AbsenceOverviewResponse, ()> = Endpoint::Get {
|
||||
url: "/api/3/absence/student",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
pub const GET_STUDENT_TIMETABLE_WITH_ABSENCES_ENDPOINT: Endpoint<
|
||||
StudentTimetableAbsenceResponse,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ContentType, Endpoint, LoginSuccess, OpenIdDiscovery, auth::login::LoginRequest};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const LOGIN_ENDPOINT: Endpoint<LoginSuccess, LoginRequest> = Endpoint::Post {
|
||||
url: "/api/login",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub enum Endpoint<Response, Request> {
|
||||
//TODO: better url handling. (defining api version/is base url used/query/url params)
|
||||
Get {
|
||||
url: &'static str,
|
||||
auth: bool,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, Events};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const EVENTS_ENDPOINT: Endpoint<Events, ()> = Endpoint::Get {
|
||||
url: "/api/3/events",
|
||||
|
||||
+11
-21
@@ -1,38 +1,28 @@
|
||||
use crate::{Room, RoomSet, SchoolClass, SchoolClassSet, StdType, Student, Teacher, TeacherSet};
|
||||
use crate::{EventTime, StdType};
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Events {
|
||||
pub events: Vec<Event>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Event {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub event_type: EventType,
|
||||
pub event_type: StdType,
|
||||
pub times: Vec<EventTime>,
|
||||
pub classes: Vec<SchoolClass>,
|
||||
pub class_sets: Vec<SchoolClassSet>,
|
||||
pub teachers: Vec<Teacher>,
|
||||
pub teacher_sets: Vec<TeacherSet>,
|
||||
pub rooms: Vec<Room>,
|
||||
pub room_sets: Vec<RoomSet>,
|
||||
pub students: Vec<Student>,
|
||||
pub classes: Vec<StdType>,
|
||||
pub class_sets: Vec<StdType>,
|
||||
pub teachers: Vec<StdType>,
|
||||
pub teacher_sets: Vec<StdType>,
|
||||
pub rooms: Vec<StdType>,
|
||||
pub room_sets: Vec<StdType>,
|
||||
pub students: Vec<StdType>,
|
||||
pub note: Option<String>,
|
||||
pub date_changed: DateTime<FixedOffset>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct EventTime {
|
||||
pub whole_day: bool,
|
||||
pub start_time: Option<DateTime<FixedOffset>>,
|
||||
pub end_time: Option<DateTime<FixedOffset>>,
|
||||
pub struct Events {
|
||||
pub events: Vec<Event>,
|
||||
}
|
||||
|
||||
pub type EventType = StdType;
|
||||
@@ -0,0 +1,10 @@
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct EventTime {
|
||||
pub whole_day: bool,
|
||||
pub start_time: Option<DateTime<FixedOffset>>,
|
||||
pub end_time: Option<DateTime<FixedOffset>>,
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
mod endpoints;
|
||||
mod event;
|
||||
mod event_time;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use event::*;
|
||||
pub use event_time::*;
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ContentType, Endpoint, GdprCommissioners, GdprConsents};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const SEND_GDPR_OBJECTION_ENDPOINT: Endpoint<(), String> = Endpoint::Post {
|
||||
url: "/api/3/gdpr/commissioner/send-objection",
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::UserType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprCommissioners {
|
||||
pub commissioners: Vec<GdprCommissioner>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprCommissioner {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub mobile: String,
|
||||
pub phone: String,
|
||||
pub email: String,
|
||||
pub web: Option<String>,
|
||||
pub data_box: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsent {
|
||||
pub id: i64,
|
||||
pub person_type: UserType,
|
||||
pub person_id: String,
|
||||
pub created: DateTime<FixedOffset>,
|
||||
pub validity: GdprValidity,
|
||||
pub valid_from: DateTime<FixedOffset>,
|
||||
pub state: GdprConsentState,
|
||||
pub title: Option<String>,
|
||||
pub personal_data: Option<String>,
|
||||
pub usage_purpose: Option<String>,
|
||||
pub valid_to: Option<DateTime<FixedOffset>>,
|
||||
pub valid_years: Option<i64>,
|
||||
pub rights: Option<GdprConsentRights>,
|
||||
pub body: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum GdprValidity {
|
||||
EndOfStudy,
|
||||
EndOfStudyPlusYears,
|
||||
ToAppeal,
|
||||
Unknown,
|
||||
Validity,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum GdprConsentState {
|
||||
Agreed,
|
||||
Cancelled,
|
||||
Disagreed,
|
||||
Expired,
|
||||
NewConsent,
|
||||
RevokeRequested,
|
||||
Revoked,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsentRights {
|
||||
pub can_agree: bool,
|
||||
pub can_disagree: bool,
|
||||
pub can_revoke_request: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsents {
|
||||
pub person_consents: Vec<GdprConsent>,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprCommissioner {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub mobile: String,
|
||||
pub phone: String,
|
||||
pub email: String,
|
||||
pub web: Option<String>,
|
||||
pub data_box: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprCommissioners {
|
||||
pub commissioners: Vec<GdprCommissioner>,
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
use crate::{GdprConsentRights, GdprConsentState, GdprValidity, UserType};
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsent {
|
||||
pub id: i64,
|
||||
pub person_type: UserType,
|
||||
pub person_id: String,
|
||||
pub created: DateTime<FixedOffset>,
|
||||
pub validity: GdprValidity,
|
||||
pub valid_from: DateTime<FixedOffset>,
|
||||
pub state: GdprConsentState,
|
||||
pub title: Option<String>,
|
||||
pub personal_data: Option<String>,
|
||||
pub usage_purpose: Option<String>,
|
||||
pub valid_to: Option<DateTime<FixedOffset>>,
|
||||
pub valid_years: Option<i64>,
|
||||
pub rights: Option<GdprConsentRights>,
|
||||
pub body: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsents {
|
||||
pub person_consents: Vec<GdprConsent>,
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct GdprConsentRights {
|
||||
pub can_agree: bool,
|
||||
pub can_disagree: bool,
|
||||
pub can_revoke_request: bool,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum GdprConsentState {
|
||||
Agreed,
|
||||
Cancelled,
|
||||
Disagreed,
|
||||
Expired,
|
||||
NewConsent,
|
||||
RevokeRequested,
|
||||
Revoked,
|
||||
Unknown,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum GdprValidity {
|
||||
EndOfStudy,
|
||||
EndOfStudyPlusYears,
|
||||
ToAppeal,
|
||||
Unknown,
|
||||
Validity,
|
||||
}
|
||||
+10
-2
@@ -1,5 +1,13 @@
|
||||
mod endpoints;
|
||||
mod gdpr;
|
||||
mod gdpr_commissioner;
|
||||
mod gdpr_consent;
|
||||
mod gdpr_consent_rights;
|
||||
mod gdpr_consent_state;
|
||||
mod gdpr_validity;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use gdpr::*;
|
||||
pub use gdpr_commissioner::*;
|
||||
pub use gdpr_consent::*;
|
||||
pub use gdpr_consent_rights::*;
|
||||
pub use gdpr_consent_state::*;
|
||||
pub use gdpr_validity::*;
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, HomeworkList};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const HOMEWORKS_COUNT_ENDPOINT: Endpoint<i64, ()> = Endpoint::Get {
|
||||
url: "/api/3/homeworks/count-actual",
|
||||
|
||||
+12
-13
@@ -1,17 +1,10 @@
|
||||
use crate::{AttachmentInfo, StdType};
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{AttachmentInfo, StdType};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct HomeworkList {
|
||||
pub homeworks: Vec<HomeworkListItem>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct HomeworkListItem {
|
||||
pub struct HomeworkItem {
|
||||
#[serde(rename = "ID")]
|
||||
pub id: String,
|
||||
pub date_start: DateTime<FixedOffset>,
|
||||
@@ -22,10 +15,16 @@ pub struct HomeworkListItem {
|
||||
pub closed: bool,
|
||||
pub electronic: bool, //check existance
|
||||
pub hour: i64,
|
||||
pub class: StdType, //HomeworkSchoolClass
|
||||
pub group: StdType, //HomeworkSchoolGroup
|
||||
pub subject: StdType, //HomeworkSchoolSubject
|
||||
pub teacher: StdType, //HomeworkTeacher
|
||||
pub class: StdType,
|
||||
pub group: StdType,
|
||||
pub subject: StdType,
|
||||
pub teacher: StdType,
|
||||
pub attachments: Vec<AttachmentInfo>,
|
||||
pub finished: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct HomeworkList {
|
||||
pub homeworks: Vec<HomeworkItem>,
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ContentType, Endpoint, Marks};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const CONFIRM_MARKS_ENDPOINT: Endpoint<(), Vec<String>> = Endpoint::Post {
|
||||
url: "/api/3/marks/SetClassificationConfirmation",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
use crate::MarkConfirmationStatus;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Mark {
|
||||
pub mark_date: DateTime<FixedOffset>,
|
||||
pub edit_date: DateTime<FixedOffset>,
|
||||
pub is_invalid_date: bool,
|
||||
pub teacher_id: Option<String>,
|
||||
pub subject_id: String,
|
||||
pub is_new: bool,
|
||||
pub is_points: bool,
|
||||
pub calculated_mark_text: String,
|
||||
pub max_points: i64,
|
||||
pub is_predictor_mark: bool,
|
||||
pub mark_confirmation_state: MarkConfirmationStatus,
|
||||
pub caption: Option<String>,
|
||||
pub theme: Option<String>,
|
||||
pub mark_text: Option<String>,
|
||||
pub r#type: Option<String>,
|
||||
pub type_note: Option<String>,
|
||||
pub weight: Option<i64>,
|
||||
pub class_rank_text: Option<String>,
|
||||
pub id: Option<String>,
|
||||
pub points_text: Option<String>,
|
||||
pub confirmed_when: Option<DateTime<FixedOffset>>,
|
||||
pub confirmed_by: Option<String>,
|
||||
pub verbal_evaluation: Option<String>,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
pub use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum MarkConfirmationStatus {
|
||||
Confirmed,
|
||||
DoesNotRequireConfirmation,
|
||||
Unconfirmed,
|
||||
UnconfirmedAfterChange,
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
mod endpoints;
|
||||
mod mark;
|
||||
mod mark_confirmation_status;
|
||||
mod subject_marks;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use mark::*;
|
||||
pub use mark_confirmation_status::*;
|
||||
pub use subject_marks::*;
|
||||
@@ -1,14 +1,6 @@
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use crate::{Mark, StdType};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::StdType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Marks {
|
||||
pub subjects: Vec<SubjectMarks>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct SubjectMarks {
|
||||
@@ -24,37 +16,6 @@ pub struct SubjectMarks {
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Mark {
|
||||
pub mark_date: DateTime<FixedOffset>,
|
||||
pub edit_date: DateTime<FixedOffset>,
|
||||
pub is_invalid_date: bool,
|
||||
pub teacher_id: Option<String>,
|
||||
pub subject_id: String,
|
||||
pub is_new: bool,
|
||||
pub is_points: bool,
|
||||
pub calculated_mark_text: String,
|
||||
pub max_points: i64,
|
||||
pub is_predictor_mark: bool,
|
||||
pub mark_confirmation_state: MarkConfirmationStatus,
|
||||
pub caption: Option<String>,
|
||||
pub theme: Option<String>,
|
||||
pub mark_text: Option<String>,
|
||||
pub r#type: Option<String>,
|
||||
pub type_note: Option<String>,
|
||||
pub weight: Option<i64>,
|
||||
pub class_rank_text: Option<String>,
|
||||
pub id: Option<String>,
|
||||
pub points_text: Option<String>,
|
||||
pub confirmed_when: Option<DateTime<FixedOffset>>,
|
||||
pub confirmed_by: Option<String>,
|
||||
pub verbal_evaluation: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum MarkConfirmationStatus {
|
||||
Confirmed,
|
||||
DoesNotRequireConfirmation,
|
||||
Unconfirmed,
|
||||
UnconfirmedAfterChange,
|
||||
pub struct Marks {
|
||||
pub subjects: Vec<SubjectMarks>,
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{ApiInfo, Endpoint};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const API_V3_INFO_ENDPOINT: Endpoint<ApiInfo, ()> = Endpoint::Get {
|
||||
url: "/api/3",
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
ClassFundMonthly, ClassFundPaymentInfo, ClassFundSummary, ClassFundTeacherDocumentDetail,
|
||||
ClassFundTeacherDocumentsMonthly, ClassFundTeacherStudentsItem, ClassFundTeacherSummary,
|
||||
Endpoint, RegularPayment, RegularPaymentDetail, RegularPaymentsSummary, RegularPrescription,
|
||||
RegularPrescriptionDetail, RegularPrescriptionStudent, RegularPrescriptionStudentDetail,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const CLASS_FUND_PAYMENT_INFO_ENDPOINT: Endpoint<ClassFundPaymentInfo, ()> = Endpoint::Get {
|
||||
url: "/api/3/payments/classfund/paymentsinfo",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{CertificateTerms, Endpoint, PedagogicalMeasures};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const GET_CERTIFICATE_TERMS_ENDPOINT: Endpoint<CertificateTerms, ()> = Endpoint::Get {
|
||||
url: "/api/3/marks/final",
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use crate::StdTypeNullable;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::StdTypeNullable;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct CertificateTerms {
|
||||
|
||||
+1
-17
@@ -16,25 +16,9 @@ pub struct StdTypeNullable {
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
pub type SchoolClass = StdType;
|
||||
|
||||
pub type StdClassGroup = StdType;
|
||||
|
||||
pub type SchoolClassSet = StdType;
|
||||
|
||||
pub type Teacher = StdType;
|
||||
|
||||
pub type TeacherSet = StdType;
|
||||
|
||||
pub type Room = StdType;
|
||||
|
||||
pub type RoomSet = StdType;
|
||||
|
||||
pub type Student = StdType;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct TimetableStudent {
|
||||
pub struct StdTypeAbbrevNullable {
|
||||
pub id: String,
|
||||
pub abbrev: Option<String>,
|
||||
pub name: String,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, Subjects};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const SUBJECTS_ENDPOINT: Endpoint<Subjects, ()> = Endpoint::Get {
|
||||
url: "/api/3/subjects",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, SubstitutionCycles, Substitutions};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const SUBSTITUTIONS_ENDPOINT: Endpoint<Substitutions, ()> = Endpoint::Get {
|
||||
url: "/api/3/substitutions",
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use crate::{AtomType, Subject};
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{AtomType, Subject};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Substitutions {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, Teaching};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
/// Subject ID = String
|
||||
pub const TEACHING_ENDPOINT: Endpoint<Teaching, ()> = Endpoint::Get {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
use crate::Subject;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::Subject;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Teaching {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, Timetable};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const PERNAMENT_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
|
||||
url: "/api/3/timetable/permanent",
|
||||
@@ -14,14 +13,12 @@ pub const PERNAMENT_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
|
||||
pub const WEEK_TIMETABLE_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
|
||||
url: "/api/3/timetable/actual",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
|
||||
|
||||
pub const WEEK_TIMETABLE_CLASS_ENDPOINT: Endpoint<Timetable, ()> = Endpoint::Get {
|
||||
url: "/api/3/timetable/actual/class/{classId}",
|
||||
auth: true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mod timetable;
|
||||
mod endpoints;
|
||||
mod timetable;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use timetable::*;
|
||||
pub use endpoints::*;
|
||||
@@ -1,8 +1,7 @@
|
||||
use crate::StdType;
|
||||
use chrono::{DateTime, FixedOffset};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{Room, StdType, Student, Teacher};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct Timetable {
|
||||
@@ -11,10 +10,10 @@ pub struct Timetable {
|
||||
pub classes: Vec<StdType>,
|
||||
pub groups: Vec<Group>,
|
||||
pub subjects: Vec<StdType>,
|
||||
pub rooms: Vec<Room>,
|
||||
pub teachers: Vec<Teacher>,
|
||||
pub rooms: Vec<StdType>,
|
||||
pub teachers: Vec<StdType>,
|
||||
pub cycles: Vec<StdType>,
|
||||
pub students: Vec<Student>,
|
||||
pub students: Vec<StdType>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{Endpoint, UserInfo};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const USER_INFO_ENDPOINT: Endpoint<UserInfo, ()> = Endpoint::Get {
|
||||
url: "/api/3/user",
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
use crate::{Module, StdType, user::ModulesSetting};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{Module, SchoolClass, user::ModulesSetting};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct UserInfo {
|
||||
#[serde(rename = "UserUID")]
|
||||
pub user_uid: String,
|
||||
pub campaign_category_code: String,
|
||||
pub class: Option<SchoolClass>,
|
||||
pub teacher_classes: Option<Vec<SchoolClass>>,
|
||||
pub class: Option<StdType>,
|
||||
pub teacher_classes: Option<Vec<StdType>>,
|
||||
pub full_name: Option<String>,
|
||||
pub school_organization_name: Option<String>,
|
||||
pub school_type: Option<SchoolType>,
|
||||
@@ -35,7 +34,7 @@ pub enum UserType {
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct UserInfoStudent {
|
||||
pub full_name: String,
|
||||
pub class: SchoolClass,
|
||||
pub class: StdType,
|
||||
pub school_type: SchoolType,
|
||||
pub study_year: Option<i64>,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user