use crate::models::channel::ChannelType; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use utoipa::ToSchema; use uuid::Uuid; #[derive(Debug, Serialize, Deserialize, ToSchema, utoipa::IntoParams)] pub struct ChannelQueryParams { pub server_id: Option, } impl Default for ChannelQueryParams { fn default() -> Self { Self { server_id: None } } } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct CreateChannelRequest { pub server_id: Option, pub category_id: Option, pub channel_type: ChannelType, #[schema(example = "général")] pub name: Option, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct UpdateChannelRequest { pub server_id: Option, pub category_id: Option, pub channel_type: ChannelType, pub name: Option, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct ChannelResponse { pub id: Uuid, pub server_id: Option, pub category_id: Option, pub channel_type: ChannelType, pub name: Option, pub created_at: DateTime, pub updated_at: DateTime, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct SetChannelPermissionRequest { /// Bitmask des permissions à appliquer. #[schema(example = 15)] pub permissions: u64, } #[derive(Debug, Serialize, ToSchema)] pub struct ChannelUserPermissionResponse { pub id: Uuid, pub channel_id: Uuid, pub user_id: Uuid, pub permissions: u64, } #[derive(Debug, Serialize, ToSchema)] pub struct ChannelRolePermissionResponse { pub id: Uuid, pub channel_id: Uuid, pub role_id: Uuid, pub permissions: u64, }