mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 16:03:31 +00:00
added login payload struct
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
use serde::Serialize;
|
|
||||||
use arma_rs::FromArma;
|
use arma_rs::FromArma;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
#[derive(Serialize)]
|
#[derive(Serialize)]
|
||||||
pub struct Marker {
|
pub struct Marker {
|
||||||
|
pub uid: String,
|
||||||
pub longitude: f64,
|
pub longitude: f64,
|
||||||
pub latitude: f64,
|
pub latitude: f64,
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub uid: String,
|
|
||||||
pub r#type: String,
|
pub r#type: String,
|
||||||
pub course: f64,
|
pub course: f64,
|
||||||
pub speed: f64,
|
pub speed: f64,
|
||||||
@@ -15,7 +15,6 @@ pub struct Marker {
|
|||||||
pub api_auth_token: String,
|
pub api_auth_token: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl FromArma for Marker {
|
impl FromArma for Marker {
|
||||||
fn from_arma(data: String) -> Result<Self, String> {
|
fn from_arma(data: String) -> Result<Self, String> {
|
||||||
let (
|
let (
|
||||||
@@ -55,3 +54,16 @@ impl FromArma for Marker {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
pub struct LoginPayload {
|
||||||
|
pub username: String,
|
||||||
|
pub password: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromArma for LoginPayload {
|
||||||
|
fn from_arma(data: String) -> Result<Self, String> {
|
||||||
|
let (username, password) = <(String, String)>::from_arma(data)?;
|
||||||
|
Ok(Self { username, password })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user