53 lines
1.2 KiB
Rust
53 lines
1.2 KiB
Rust
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<String>,
|
|
#[serde(default)]
|
|
pub is_default: bool,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct UpdateServerRequest {
|
|
pub name: String,
|
|
pub password: Option<String>,
|
|
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<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
#[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,
|
|
}
|