added user->crimes
This commit is contained in:
parent
1eec2477c6
commit
259f09aef5
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "torn-api"
|
name = "torn-api"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Pyrit [2111649]"]
|
authors = ["Pyrit [2111649]"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -19,6 +19,8 @@ pub enum Selection {
|
||||||
Discord,
|
Discord,
|
||||||
#[api(type = "PersonalStats", field = "personalstats")]
|
#[api(type = "PersonalStats", field = "personalstats")]
|
||||||
PersonalStats,
|
PersonalStats,
|
||||||
|
#[api(type = "CriminalRecord", field = "criminalrecord")]
|
||||||
|
Crimes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize)]
|
||||||
|
@ -371,6 +373,19 @@ pub struct PersonalStats {
|
||||||
pub best_damage: i32,
|
pub best_damage: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
pub struct CriminalRecord {
|
||||||
|
pub selling_illegal_products: i32,
|
||||||
|
pub theft: i32,
|
||||||
|
pub auto_theft: i32,
|
||||||
|
pub drug_deals: i32,
|
||||||
|
pub computer_crimes: i32,
|
||||||
|
pub murder: i32,
|
||||||
|
pub fraud_crimes: i32,
|
||||||
|
pub other: i32,
|
||||||
|
pub total: i32,
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
@ -388,6 +403,7 @@ mod tests {
|
||||||
Selection::Discord,
|
Selection::Discord,
|
||||||
Selection::Profile,
|
Selection::Profile,
|
||||||
Selection::PersonalStats,
|
Selection::PersonalStats,
|
||||||
|
Selection::Crimes,
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue