2025-02-06 17:09:04 +08:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
2025-02-07 16:31:05 +08:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2025-02-06 17:09:04 +08:00
|
|
|
pub struct RichLabel {
|
|
|
|
|
pub label: Option<String>,
|
|
|
|
|
pub key: Option<String>,
|
|
|
|
|
pub icon: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-07 16:31:05 +08:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2025-02-06 17:09:04 +08:00
|
|
|
pub struct DataSourceReference {
|
|
|
|
|
pub r#type: Option<String>,
|
|
|
|
|
pub name: Option<String>,
|
|
|
|
|
pub id: Option<String>,
|
2025-03-30 22:20:15 +08:00
|
|
|
pub icon: Option<String>,
|
2025-02-06 17:09:04 +08:00
|
|
|
}
|
|
|
|
|
|
2025-02-07 16:31:05 +08:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2025-02-06 17:09:04 +08:00
|
|
|
pub struct UserInfo {
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub username: Option<String>,
|
|
|
|
|
pub userid: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-07 16:31:05 +08:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
2025-02-06 17:09:04 +08:00
|
|
|
pub struct EditorInfo {
|
|
|
|
|
pub user: UserInfo,
|
|
|
|
|
pub timestamp: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-21 19:40:46 +08:00
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
2025-02-06 17:09:04 +08:00
|
|
|
pub struct Document {
|
|
|
|
|
pub id: String,
|
|
|
|
|
pub created: Option<String>,
|
|
|
|
|
pub updated: Option<String>,
|
|
|
|
|
pub source: Option<DataSourceReference>,
|
|
|
|
|
pub r#type: Option<String>,
|
|
|
|
|
pub category: Option<String>,
|
|
|
|
|
pub subcategory: Option<String>,
|
|
|
|
|
pub categories: Option<Vec<String>>,
|
|
|
|
|
pub rich_categories: Option<Vec<RichLabel>>,
|
|
|
|
|
pub title: Option<String>,
|
|
|
|
|
pub summary: Option<String>,
|
|
|
|
|
pub lang: Option<String>,
|
|
|
|
|
pub content: Option<String>,
|
|
|
|
|
pub icon: Option<String>,
|
|
|
|
|
pub thumbnail: Option<String>,
|
|
|
|
|
pub cover: Option<String>,
|
|
|
|
|
pub tags: Option<Vec<String>>,
|
|
|
|
|
pub url: Option<String>,
|
|
|
|
|
pub size: Option<i64>,
|
|
|
|
|
pub metadata: Option<HashMap<String, serde_json::Value>>,
|
|
|
|
|
pub payload: Option<HashMap<String, serde_json::Value>>,
|
|
|
|
|
pub owner: Option<UserInfo>,
|
|
|
|
|
pub last_updated_by: Option<EditorInfo>,
|
|
|
|
|
}
|