init
This commit is contained in:
+12
-12
@@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user