This commit is contained in:
2025-08-11 16:59:31 +02:00
parent d691c1d944
commit 39d1d9a2b7
14 changed files with 535 additions and 13 deletions

View File

@@ -1,3 +1,4 @@
use std::hash::{Hash, Hasher};
// use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
// use uuid::Uuid;
@@ -29,4 +30,18 @@ impl Channel {
created_at: Utc::now(),
}
}
}
impl PartialEq for Channel {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Eq for Channel {}
impl Hash for Channel {
fn hash<H: Hasher>(&self, state: &mut H) {
self.id.hash(state);
}
}

View File

@@ -3,6 +3,7 @@ pub mod channel;
pub mod user;
pub mod message;
pub mod link_sub_server_user;
mod models;
pub use sub_server::*;
pub use channel::*;

View File

@@ -1,8 +1,10 @@
// L'application peut avoir plusieurs sous servers
use std::hash::{Hash, Hasher};
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::store::models::Channel;
#[derive(Debug, Clone, sqlx::FromRow, Serialize, Deserialize)]
pub struct SubServer {
@@ -21,4 +23,18 @@ impl SubServer {
created_at: Utc::now(),
}
}
}
impl PartialEq for SubServer {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Eq for SubServer {}
impl Hash for SubServer {
fn hash<H: Hasher>(&self, state: &mut H) {
self.id.hash(state);
}
}