leptos
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Johannes Heuel
2023-10-02 14:31:22 +02:00
parent db2bf1994e
commit a576e572d9
34 changed files with 2976 additions and 987 deletions

8
api-boundary/Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "api-boundary"
version = "0.0.0"
edition = "2021"
publish = false
[dependencies]
serde = { version = "1.0", features = ["derive"] }

67
api-boundary/src/lib.rs Normal file
View File

@@ -0,0 +1,67 @@
use serde::{Deserialize, Serialize};
// #[derive(Serialize, Deserialize)]
// pub struct Credentials {
// pub email: String,
// pub password: String,
// }
// #[derive(Clone, Serialize, Deserialize)]
// pub struct UserInfo {
// pub email: String,
// }
#[derive(Clone, Serialize, Deserialize)]
pub struct ApiToken {
pub token: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Error {
pub message: String,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct UserInfo {
pub id: Option<String>,
pub username: String,
pub email: String,
pub password: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct UserWrapper {
pub user: UserInfo,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct UserWithToken {
pub id: String,
pub username: String,
pub email: String,
pub password: String,
pub token: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct UserTokenWrapper {
pub user: UserWithToken,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct Credentials {
pub email: String,
pub password: String,
}
#[derive(Debug, Deserialize, Serialize)]
pub struct LoginWrapper {
pub user: Credentials,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
pub struct OutputPicture {
pub thumbnail: Option<String>,
pub width: u32,
pub height: u32,
}