init
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use utoipa::ToSchema;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema, utoipa::IntoParams)]
|
||||
pub struct CategoryQueryParams {
|
||||
pub server_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
impl Default for CategoryQueryParams {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
server_id: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
pub struct CreateCategoryRequest {
|
||||
pub server_id: Uuid,
|
||||
#[schema(example = "Discussion")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
pub struct UpdateCategoryRequest {
|
||||
#[schema(example = "Discussion (Maj)")]
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, ToSchema)]
|
||||
pub struct CategoryResponse {
|
||||
pub id: Uuid,
|
||||
pub server_id: Uuid,
|
||||
pub name: String,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
}
|
||||
Reference in New Issue
Block a user