Compare commits
6
Commits
endpoints
...
636415e14a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
636415e14a
|
||
|
|
ba5d74d898
|
||
|
|
eab1110c75 | ||
|
|
ab5d8c0339
|
||
|
|
88668c3b9d
|
||
|
|
ca8c203852 |
No files matched your search
@@ -22,5 +22,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build
|
||||
run: cargo build --verbose --all-features
|
||||
- name: Run clippy
|
||||
run: cargo clippy --verbose --all-features
|
||||
- name: Run tests
|
||||
run: cargo test --verbose --all-features
|
||||
@@ -0,0 +1,13 @@
|
||||
# bakalari-types
|
||||
### cz🇨🇿
|
||||
|
||||
Rustové typy pro práci s daty z API Bakalářů.
|
||||
|
||||
Tato crate poskytuje modely a definice koncových bodů pro oblasti, jako jsou autentizace, docházka, události, domácí úkoly, známky, platby, předměty, suplování, výuka, rozvrhy a údaje o uživatelích. Jde o knihovnu typů; neobsahuje HTTP klienta.
|
||||
|
||||
---
|
||||
### en🇬🇧
|
||||
|
||||
Rust types for working with data from the Bakaláři API.
|
||||
|
||||
The crate provides models and endpoint definitions for areas such as authentication, attendance, events, homework, marks, payments, subjects, substitutions, teaching, timetables, and user data. It is a types library; it does not provide an HTTP client.
|
||||
+7
-6
@@ -1,14 +1,11 @@
|
||||
mod absence;
|
||||
mod others;
|
||||
//campaign
|
||||
mod auth;
|
||||
mod endpoints;
|
||||
mod events;
|
||||
mod gdpr;
|
||||
//komens
|
||||
mod homework; //TDOS
|
||||
//marking
|
||||
mod homework;
|
||||
mod marks;
|
||||
mod others;
|
||||
mod payments;
|
||||
mod semester;
|
||||
mod stdtype;
|
||||
@@ -17,7 +14,10 @@ mod substitutions;
|
||||
mod teaching;
|
||||
mod timetable;
|
||||
mod user;
|
||||
//webmodules
|
||||
mod webmodules;
|
||||
//campaign
|
||||
//marking
|
||||
//komens
|
||||
//predictor
|
||||
|
||||
pub use absence::*;
|
||||
@@ -36,3 +36,4 @@ pub use substitutions::*;
|
||||
pub use teaching::*;
|
||||
pub use timetable::*;
|
||||
pub use user::*;
|
||||
pub use webmodules::*;
|
||||
@@ -3,14 +3,6 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::PaymentsTeacherStudentStatus;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ClassfundSummary {
|
||||
pub student_name_with_class: Option<String>,
|
||||
pub balance: f64,
|
||||
pub spent: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct ClassFundPaymentInfo {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
use crate::{Endpoint, WebModulesResponse};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
pub const WEBMODULES_ENDPOINT: Endpoint<WebModulesResponse, ()> = Endpoint::Get {
|
||||
url: "/api/3/webmodule",
|
||||
auth: true,
|
||||
_types: PhantomData,
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
mod endpoints;
|
||||
mod web_module;
|
||||
mod web_module_dashboard;
|
||||
mod web_module_icon;
|
||||
mod web_module_sub_menu;
|
||||
mod web_modules_response;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use web_module::*;
|
||||
pub use web_module_dashboard::*;
|
||||
pub use web_module_icon::*;
|
||||
pub use web_module_sub_menu::*;
|
||||
pub use web_modules_response::*;
|
||||
@@ -0,0 +1,12 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{WebModuleIcon, WebModuleSubMenu};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct WebModule {
|
||||
pub icon_id: WebModuleIcon,
|
||||
pub url: Option<String>,
|
||||
pub name: String,
|
||||
pub sub_menu: Vec<WebModuleSubMenu>,
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{WebModuleIcon, WebModuleSubMenu};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct WebModuleDashboard {
|
||||
pub icon_id: WebModuleIcon,
|
||||
pub url: String,
|
||||
pub name: Option<String>,
|
||||
pub sub_menu: Vec<WebModuleSubMenu>,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum WebModuleIcon {
|
||||
Akademie,
|
||||
Ankety,
|
||||
Dokumenty,
|
||||
Druzina,
|
||||
Potvrzeni,
|
||||
VyukoveZdroje,
|
||||
WebovyModul,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct WebModuleSubMenu {
|
||||
pub url: String,
|
||||
pub name: String,
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{WebModule, WebModuleDashboard};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct WebModulesResponse {
|
||||
pub web_modules: Vec<WebModule>,
|
||||
pub dashboard: WebModuleDashboard,
|
||||
}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
# implementations
|
||||
|
||||
- [ ] absence
|
||||
- [x] absence
|
||||
- [x] campaign
|
||||
- [ ] campaign error
|
||||
- [ ] class book
|
||||
@@ -17,7 +17,7 @@
|
||||
- [x] substitutions
|
||||
- [x] teaching
|
||||
- [x] timetable
|
||||
- [ ] webmodules
|
||||
- [x] webmodules
|
||||
- [x] user
|
||||
|
||||
# Features
|
||||
@@ -35,7 +35,7 @@
|
||||
- [ ] /api/3/classbook/lessonTags
|
||||
- [ ] /api/3/komens/messages/rating/:messageId
|
||||
- [x] /api/3/absence/student
|
||||
- [ ] /api/3/webmodule
|
||||
- [x] /api/3/webmodule
|
||||
- [x] /api/3/timetable/actual
|
||||
- [x] /api/3/payments/classfund/teacher/document/detail/:documentId
|
||||
- [x] /api/3
|
||||
|
||||
Reference in new issue
Block a user