1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 08:25:16 +00:00

Add post with weblink support

This commit is contained in:
2020-07-03 10:18:26 +02:00
parent a359b6656f
commit 689cf07ee4
3 changed files with 45 additions and 11 deletions

View File

@ -37,11 +37,24 @@ pub enum PostPageKind {
PAGE_KIND_GROUP(GroupID),
}
pub struct PostFile {
pub path: String,
pub size: usize,
pub file_type: Option<String>,
}
pub struct PostWebLink {
pub url: String,
pub title: Option<String>,
pub description: Option<String>,
pub image: Option<String>,
}
#[allow(non_camel_case_types)]
pub enum PostKind {
POST_KIND_TEXT,
POST_KIND_IMAGE(PostFile),
POST_KIND_WEBLINK,
POST_KIND_WEBLINK(PostWebLink),
POST_KIND_PDF,
POST_KIND_MOVIE,
POST_KIND_COUNTDOWN,
@ -54,7 +67,7 @@ impl PostKind {
match self {
PostKind::POST_KIND_TEXT => "text",
PostKind::POST_KIND_IMAGE(_) => "image",
PostKind::POST_KIND_WEBLINK => "weblink",
PostKind::POST_KIND_WEBLINK(_) => "weblink",
PostKind::POST_KIND_PDF => "pdf",
PostKind::POST_KIND_MOVIE => "movie",
PostKind::POST_KIND_COUNTDOWN => "countdown",
@ -64,12 +77,6 @@ impl PostKind {
}
}
pub struct PostFile {
pub path: String,
pub size: usize,
pub file_type: Option<String>,
}
pub struct Post {
pub id: u64,
pub user_id: UserID,