Skip to content
Clone

feat(export): add project documents export

zhenyi committed
parent a7bf59f commit c8685d5 Browse files

1 file changed

+44 −0

Added lib/export/project/documents.rs View lib/export/project/documents.rs
@@ -0,0 +1,44 @@
1use serde::{Deserialize, Serialize};
2use time::OffsetDateTime;
3use utoipa::ToSchema;
4use uuid::Uuid;
5
6#[derive(Debug, Clone, Deserialize, ToSchema)]
7pub struct CreateDocumentCmd {
8 pub parent_id: Option<Uuid>,
9 pub title: String,
10 pub slug: String,
11 #[serde(default)]
12 pub content: String,
13 pub icon: Option<String>,
14}
15
16#[derive(Debug, Clone, Deserialize, ToSchema)]
17pub struct UpdateDocumentCmd {
18 pub parent_id: Option<Uuid>,
19 pub title: Option<String>,
20 pub slug: Option<String>,
21 pub content: Option<String>,
22 pub icon: Option<String>,
23}
24
25#[derive(Debug, Clone, Serialize, ToSchema)]
26pub struct DocumentView {
27 pub id: Uuid,
28 pub project_id: Uuid,
29 pub parent_id: Option<Uuid>,
30 pub creator_id: Uuid,
31 pub last_editor_id: Option<Uuid>,
32 pub title: String,
33 pub slug: String,
34 pub content: String,
35 pub icon: Option<String>,
36 pub created_at: OffsetDateTime,
37 pub updated_at: Option<OffsetDateTime>,
38}
39
40#[derive(Debug, Clone, Serialize, ToSchema)]
41pub struct DocumentPage {
42 pub total: u64,
43 pub items: Vec<DocumentView>,
44}
No newline at end of file