init
This commit is contained in:
24
src/store/models/sub_server.rs
Normal file
24
src/store/models/sub_server.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
// L'application peut avoir plusieurs sous servers
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Clone, sqlx::FromRow, Serialize, Deserialize)]
|
||||
pub struct SubServer {
|
||||
pub id: Uuid,
|
||||
pub name: String,
|
||||
pub password: String, // voir si on le hash, mais sera certainement pas nécessaire.
|
||||
pub created_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
impl SubServer {
|
||||
pub fn new(name: String, password: String) -> Self {
|
||||
Self {
|
||||
id: Uuid::new_v4(),
|
||||
name,
|
||||
password,
|
||||
created_at: Utc::now(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user