This commit is contained in:
2025-07-29 20:20:02 +02:00
parent 9b8461314f
commit 62dc6deb79
36 changed files with 2837 additions and 37 deletions

View File

@@ -0,0 +1,32 @@
// use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
// use uuid::Uuid;
use sqlx::types::{Uuid, chrono::{{ DateTime, Utc}}};
#[derive(Debug, Clone, sqlx::FromRow, Serialize, Deserialize)]
pub struct Channel {
pub id: Uuid,
pub sub_server_id: Uuid,
pub channel_type: ChannelType,
pub name: String,
pub created_at: DateTime<Utc>,
}
#[derive(Debug, Clone, sqlx::Type, Serialize, Deserialize)]
#[repr(i32)]
pub enum ChannelType {
Text = 0,
Voice = 1,
}
impl Channel {
pub fn new(sub_server_id: Uuid, channel_type: ChannelType, name: String) -> Self {
Self {
id: Uuid::new_v4(),
sub_server_id,
channel_type,
name,
created_at: Utc::now(),
}
}
}