use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use utoipa::ToSchema; use uuid::Uuid; #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct CreateServerRequest { #[schema(example = "Mon Super Serveur")] pub name: String, pub password: Option, #[serde(default)] pub is_default: bool, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct UpdateServerRequest { pub name: String, pub password: Option, pub is_default: bool, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct ServerResponse { pub id: Uuid, pub name: String, pub is_default: bool, pub created_at: DateTime, pub updated_at: DateTime, } #[derive(Debug, Serialize, Deserialize, ToSchema)] pub struct SetServerPermissionRequest { /// Bitmask des permissions à appliquer. #[schema(example = 7)] pub permissions: u64, } #[derive(Debug, Serialize, ToSchema)] pub struct ServerUserPermissionResponse { pub id: Uuid, pub server_id: Uuid, pub user_id: Uuid, pub permissions: u64, } #[derive(Debug, Serialize, ToSchema)] pub struct ServerRolePermissionResponse { pub id: Uuid, pub server_id: Uuid, pub role_id: Uuid, pub permissions: u64, }