This commit is contained in:
Dominic Grimm 2023-01-27 18:31:44 +01:00
parent 171df04dad
commit 80470c2fc9
No known key found for this signature in database
GPG Key ID: 6F294212DEAAC530
1 changed files with 12 additions and 2 deletions

View File

@ -738,13 +738,21 @@ impl Client {
}
pub async fn student_reports(&self, class_id: i32) -> Result<()> {
#[derive(Deserialize, Debug)]
struct Data {
finished: bool,
error: bool,
#[serde(rename = "reportParams")]
report_params: String,
}
let mut url = self.webuntis_url.join("reports.do")?;
url.query_pairs_mut()
.append_pair("name", "Student")
.append_pair("format", "csv")
.append_pair("klasseId", &class_id.to_string())
.append_pair("studentsForDate", "true");
let resp = reqwest::Client::new()
let resp: Data = reqwest::Client::new()
.get(url)
.header(reqwest::header::USER_AGENT, &self.user_agent)
.header(reqwest::header::ACCEPT, "application/json")
@ -757,8 +765,10 @@ impl Client {
Client::construct_bearer(&self.authorization.as_ref().context("Not logged in")?),
)
.send()
.await?
.json()
.await?;
dbg!(resp.text().await?);
dbg!(resp);
Ok(())
}