Added chat room client type

This commit is contained in:
Franklin 2023-02-09 15:58:08 -04:00
parent bbbbec7b85
commit 8f8f229956
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub struct ChatRoom {
pub id: u32,
pub title: String,
#[serde(rename = "ownerId")]
pub owner_id: u32,
#[serde(rename = "timeCreated")]
pub time_created: i64,
#[serde(rename = "lastUpdated")]
pub last_updated: i64,
}
impl From<crate::domain::chat_room::ChatRoom> for ChatRoom {
fn from(value: crate::domain::chat_room::ChatRoom) -> Self {
Self {
id: value.id,
title: value.title,
owner_id: value.owner_id,
time_created: value.time_created.timestamp_millis(),
last_updated: value.last_updated.timestamp_millis(),
}
}
}