more docs!

This commit is contained in:
Hamcha 2023-07-21 16:01:51 +02:00
parent bac09e5778
commit 4f6deaa70b
Signed by: hamcha
GPG key ID: 1669C533B8CF6D89
2 changed files with 11 additions and 0 deletions

View file

@ -28,9 +28,16 @@ pub struct Collection {
#[derive(Debug, Serialize, ToSchema)] #[derive(Debug, Serialize, ToSchema)]
pub struct CollectionData { pub struct CollectionData {
/// Collection ID
pub id: Uuid, pub id: Uuid,
/// Site ID
pub slug: String, pub slug: String,
/// Collection URL name
pub name: String, pub name: String,
/// Collection parent (eg. blog categories have blog as parent)
pub parent: Option<Uuid>, pub parent: Option<Uuid>,
} }

View file

@ -9,6 +9,7 @@ use crate::cursor::{AsCursor, CursorList};
use super::Error; use super::Error;
/// Post as stored in repository
#[derive(Deserialize, Serialize, FromRow)] #[derive(Deserialize, Serialize, FromRow)]
pub struct Post { pub struct Post {
/// Post ID /// Post ID
@ -47,9 +48,11 @@ pub struct Post {
pub deleted_at: Option<NaiveDateTime>, pub deleted_at: Option<NaiveDateTime>,
} }
/// A single block in a post
#[derive(Deserialize, Serialize, Debug, ToSchema)] #[derive(Deserialize, Serialize, Debug, ToSchema)]
#[serde(tag = "kind")] #[serde(tag = "kind")]
pub enum PostBlock { pub enum PostBlock {
/// Markdown-formatted text
MarkupV1 { MarkupV1 {
/// Markup format (markdown, html, plain) /// Markup format (markdown, html, plain)
format: String, format: String,
@ -57,6 +60,7 @@ pub enum PostBlock {
/// Markup content (before rendering) /// Markup content (before rendering)
content: String, content: String,
}, },
/// Image gallery
GalleryV1 { GalleryV1 {
/// Images in the gallery /// Images in the gallery
images: Vec<ImageElement>, images: Vec<ImageElement>,