This commit is contained in:
2026-08-08 14:17:24 +02:00
parent e9fe51363f
commit 0d8c86af16
12 changed files with 835 additions and 151 deletions
+12 -12
View File
@@ -14,6 +14,15 @@ pub struct MessageResponse {
pub reply_to_id: Option<Uuid>,
}
#[derive(Debug, Serialize, ToSchema)]
pub struct MessagePageResponse {
pub messages: Vec<MessageResponse>,
pub oldest_id: Option<Uuid>,
pub newest_id: Option<Uuid>,
pub has_more_before: bool,
pub has_more_after: bool,
}
#[derive(Debug, Serialize, Deserialize, ToSchema)]
pub struct CreateMessageRequest {
pub channel_id: Uuid,
@@ -26,19 +35,10 @@ pub struct UpdateMessageRequest {
pub content: String,
}
#[derive(serde::Deserialize, utoipa::IntoParams)]
#[derive(Debug, serde::Deserialize, utoipa::IntoParams)]
pub struct MessageQueryParams {
pub channel_id: Option<uuid::Uuid>,
pub channel_id: Uuid,
pub before_id: Option<Uuid>,
pub after_id: Option<Uuid>,
pub limit: Option<u64>,
}
impl Default for MessageQueryParams {
fn default() -> Self {
Self {
channel_id: None,
before_id: None,
limit: Some(50),
}
}
}