34 lines
793 B
Rust
34 lines
793 B
Rust
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
|
|
pub struct User {
|
|
pub id: i32,
|
|
pub username: String,
|
|
#[serde(skip_serializing)]
|
|
pub password_hash: String,
|
|
pub permissions_mask: String,
|
|
pub created_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct CreateUser {
|
|
pub username: String,
|
|
pub password: String,
|
|
pub permissions_mask: Option<String>,
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct UpdateUser {
|
|
pub username: Option<String>,
|
|
pub password: Option<String>,
|
|
pub permissions_mask: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
pub struct LoginRequest {
|
|
pub username: String,
|
|
pub password: String,
|
|
}
|