Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8e173d831 | ||
|
|
6975475330 |
+21
-10
@@ -2,17 +2,28 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
pub id: uuid::Uuid,
|
pub id: uuid::Uuid,
|
||||||
pub phone_number: String,
|
pub phone_number: String,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password: String,
|
pub password: String,
|
||||||
// Firstname is a pointer
|
// Firstname is a pointer
|
||||||
pub firstname: String,
|
pub firstname: String,
|
||||||
// Lastname is a pointer
|
// Lastname is a pointer
|
||||||
pub lastname: String,
|
pub lastname: String,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
pub created: Option<time::OffsetDateTime>,
|
pub created: Option<time::OffsetDateTime>,
|
||||||
#[serde(with = "time::serde::rfc3339::option")]
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
pub last_login: Option<time::OffsetDateTime>,
|
pub last_login: Option<time::OffsetDateTime>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
|
pub struct ServiceUser {
|
||||||
|
pub id: uuid::Uuid,
|
||||||
|
pub username: String,
|
||||||
|
pub passphrase: String,
|
||||||
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
|
pub created: Option<time::OffsetDateTime>,
|
||||||
|
// When serializing to json, if empty do not populate
|
||||||
|
#[serde(with = "time::serde::rfc3339::option")]
|
||||||
|
pub last_login: Option<time::OffsetDateTime>,
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user