diff --git a/deepwell/src/services/blob/structs.rs b/deepwell/src/services/blob/structs.rs index 1ff7176ee9e..e1b6a8ea7b9 100644 --- a/deepwell/src/services/blob/structs.rs +++ b/deepwell/src/services/blob/structs.rs @@ -31,6 +31,8 @@ pub struct StartBlobUpload { pub struct StartBlobUploadOutput { pub pending_blob_id: String, pub presign_url: String, + + #[serde(with = "time::serde::rfc3339")] pub expires_at: OffsetDateTime, } @@ -60,5 +62,7 @@ pub struct GetBlobOutput { pub data: Vec, pub mime: String, pub size: i64, + + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, } diff --git a/deepwell/src/services/file/structs.rs b/deepwell/src/services/file/structs.rs index 8969487426f..14e2ec6db0d 100644 --- a/deepwell/src/services/file/structs.rs +++ b/deepwell/src/services/file/structs.rs @@ -61,12 +61,16 @@ pub struct GetFileDetails<'a> { #[derive(Serialize, Debug, Clone)] pub struct GetFileOutput { pub file_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub file_created_at: OffsetDateTime, pub file_updated_at: Option, pub file_deleted_at: Option, pub page_id: i64, pub revision_id: i64, pub revision_type: FileRevisionType, + + #[serde(with = "time::serde::rfc3339")] pub revision_created_at: OffsetDateTime, pub revision_number: i32, pub revision_user_id: i64, diff --git a/deepwell/src/services/import/structs.rs b/deepwell/src/services/import/structs.rs index 01c15b622e3..29fea78dbd4 100644 --- a/deepwell/src/services/import/structs.rs +++ b/deepwell/src/services/import/structs.rs @@ -23,6 +23,8 @@ use time::{Date, OffsetDateTime}; #[derive(Deserialize, Debug)] pub struct ImportUser { pub user_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, pub name: String, pub slug: String, @@ -40,6 +42,8 @@ pub struct ImportUser { #[derive(Deserialize, Debug)] pub struct ImportSite { pub site_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, pub name: String, pub slug: String, @@ -50,6 +54,8 @@ pub struct ImportSite { pub struct ImportPage { pub page_id: i64, pub site_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, pub slug: String, pub locked: bool, diff --git a/deepwell/src/services/link/structs.rs b/deepwell/src/services/link/structs.rs index 8878f0f3466..4360fe6ef1f 100644 --- a/deepwell/src/services/link/structs.rs +++ b/deepwell/src/services/link/structs.rs @@ -89,6 +89,7 @@ pub struct GetLinksExternalToOutput { #[derive(Serialize, Debug, Clone)] pub struct ToExternalLink { + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, pub updated_at: Option, pub page_id: i64, diff --git a/deepwell/src/services/page/structs.rs b/deepwell/src/services/page/structs.rs index 0b3967f2e23..3d19ab20fb2 100644 --- a/deepwell/src/services/page/structs.rs +++ b/deepwell/src/services/page/structs.rs @@ -92,6 +92,8 @@ pub struct GetPageAnyDetails { #[derive(Serialize, Debug, Clone)] pub struct GetPageOutput { pub page_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub page_created_at: OffsetDateTime, pub page_updated_at: Option, pub page_deleted_at: Option, @@ -102,11 +104,15 @@ pub struct GetPageOutput { pub discussion_thread_id: Option, pub revision_id: i64, pub revision_type: PageRevisionType, + + #[serde(with = "time::serde::rfc3339")] pub revision_created_at: OffsetDateTime, pub revision_number: i32, pub revision_user_id: i64, pub wikitext: Option, pub compiled_html: Option, + + #[serde(with = "time::serde::rfc3339")] pub compiled_at: OffsetDateTime, pub compiled_generator: String, pub revision_comments: String, @@ -122,8 +128,12 @@ pub struct GetPageOutput { #[derive(Serialize, Debug, Clone)] pub struct GetDeletedPageOutput { pub page_id: i64, + + #[serde(with = "time::serde::rfc3339")] pub page_created_at: OffsetDateTime, pub page_updated_at: Option, + + #[serde(with = "time::serde::rfc3339")] pub page_deleted_at: OffsetDateTime, pub page_revision_count: i32, pub site_id: i64, diff --git a/deepwell/src/services/page_query/structs.rs b/deepwell/src/services/page_query/structs.rs index aa099b476bc..2fc063eb466 100644 --- a/deepwell/src/services/page_query/structs.rs +++ b/deepwell/src/services/page_query/structs.rs @@ -18,6 +18,7 @@ * along with this program. If not, see . */ +// TODO: add serde, include time fmt conversions #![allow(dead_code)] // TEMP use super::prelude::*; diff --git a/deepwell/src/services/page_revision/structs.rs b/deepwell/src/services/page_revision/structs.rs index 4905cd8c74e..3d7ecda5211 100644 --- a/deepwell/src/services/page_revision/structs.rs +++ b/deepwell/src/services/page_revision/structs.rs @@ -158,6 +158,8 @@ pub struct PageRevisionCountOutput { pub struct PageRevisionModelFiltered { pub revision_id: i64, pub revision_type: PageRevisionType, + + #[serde(with = "time::serde::rfc3339")] pub created_at: OffsetDateTime, pub updated_at: Option, pub from_wikidot: bool, @@ -168,6 +170,8 @@ pub struct PageRevisionModelFiltered { pub changes: Vec, pub wikitext: Option, pub compiled_html: Option, + + #[serde(with = "time::serde::rfc3339")] pub compiled_at: OffsetDateTime, pub compiled_generator: String, pub comments: Option, diff --git a/deepwell/src/services/render/structs.rs b/deepwell/src/services/render/structs.rs index 0d7c4e2a391..aee9ce19e96 100644 --- a/deepwell/src/services/render/structs.rs +++ b/deepwell/src/services/render/structs.rs @@ -27,6 +27,8 @@ pub struct RenderOutput { pub html_output: HtmlOutput, pub errors: Vec, pub compiled_hash: TextHash, + + #[serde(with = "time::serde::rfc3339")] pub compiled_at: OffsetDateTime, pub compiled_generator: String, }