Implement multipart upload endpoints
This commit is contained in:
parent
f4a87d073a
commit
72be6ba18b
4 changed files with 176 additions and 55 deletions
|
|
@ -1,3 +1,6 @@
|
|||
use aide_axum_typed_multipart::FieldData;
|
||||
use axum::body::Bytes;
|
||||
use axum_typed_multipart::TryFromMultipart;
|
||||
use chrono::{DateTime, Utc};
|
||||
use schemars::JsonSchema;
|
||||
use serde::{self, Deserialize};
|
||||
|
|
@ -12,6 +15,14 @@ pub struct CreateDocumentVersion {
|
|||
pub content_base64: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, TryFromMultipart, JsonSchema)]
|
||||
pub struct CreateDocumentVersionMultipart {
|
||||
pub relative_path: String,
|
||||
pub created_date: DateTime<Utc>,
|
||||
#[form_data(limit = "unlimited")]
|
||||
pub content: FieldData<Bytes>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UpdateDocumentVersion {
|
||||
|
|
@ -21,6 +32,16 @@ pub struct UpdateDocumentVersion {
|
|||
pub content_base64: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, TryFromMultipart, JsonSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UpdateDocumentVersionMultipart {
|
||||
pub parent_version_id: VaultUpdateId,
|
||||
pub relative_path: String,
|
||||
pub created_date: DateTime<Utc>,
|
||||
#[form_data(limit = "unlimited")]
|
||||
pub content: FieldData<Bytes>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DeleteDocumentVersion {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue