Added chat_user type

This commit is contained in:
Franklin 2023-01-30 22:04:55 -04:00
parent 1a5c95118e
commit 875b60a608
4 changed files with 19 additions and 2 deletions

View File

@ -12,3 +12,9 @@ pub struct ChatRoom {
#[serde(rename = "lastUpdated")]
pub last_updated: DateTime<Utc>,
}
impl ChatRoom {
pub fn new(title: String, owner_id: u32) -> Self {
Self { id: 0, title, owner_id, time_created: Utc::now(), last_updated: Utc::now() }
}
}

9
src/domain/chat_user.rs Normal file
View File

@ -0,0 +1,9 @@
use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub struct ChatUser {
pub chat_room_id: u32,
pub user_id: u32,
pub time_joined: DateTime<Utc>,
}

View File

@ -1,3 +1,4 @@
pub mod chat_message;
pub mod chat_message_update;
pub mod chat_room;
pub mod chat_room;
pub mod chat_user;

View File

@ -1 +1,2 @@
pub mod domain;
pub mod domain;
pub mod dto;