38 lines
1019 B
Rust
38 lines
1019 B
Rust
use crate::models::channel::ChannelType;
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use utoipa::ToSchema;
|
|
use uuid::Uuid;
|
|
|
|
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct CreateChannelRequest {
|
|
pub server_id: Option<Uuid>,
|
|
pub category_id: Option<Uuid>,
|
|
#[serde(default)]
|
|
pub position: i32,
|
|
pub channel_type: ChannelType,
|
|
#[schema(example = "général")]
|
|
pub name: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct UpdateChannelRequest {
|
|
pub server_id: Option<Uuid>,
|
|
pub category_id: Option<Uuid>,
|
|
pub position: i32,
|
|
pub channel_type: ChannelType,
|
|
pub name: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
|
pub struct ChannelResponse {
|
|
pub id: Uuid,
|
|
pub server_id: Option<Uuid>,
|
|
pub category_id: Option<Uuid>,
|
|
pub position: i32,
|
|
pub channel_type: ChannelType,
|
|
pub name: Option<String>,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|