20260513 mindmap优化01
This commit is contained in:
@@ -112,6 +112,9 @@ pub enum KernelProjectionResourceKind {
|
||||
Asset,
|
||||
AssetFolder,
|
||||
Mindmap,
|
||||
Attachment,
|
||||
OnlyOffice,
|
||||
Code,
|
||||
Table,
|
||||
Book,
|
||||
Pdf,
|
||||
@@ -131,6 +134,35 @@ pub enum KernelProjectionAssetKind {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum KernelObjectKind {
|
||||
Page,
|
||||
Index,
|
||||
Mindmap,
|
||||
Attachment,
|
||||
OnlyOffice,
|
||||
Code,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KernelObjectIdentity {
|
||||
pub object_kind: KernelObjectKind,
|
||||
pub document_id: Option<String>,
|
||||
pub block_id: Option<String>,
|
||||
pub asset_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct KernelBlockAssetRelation {
|
||||
pub document_id: String,
|
||||
pub block_id: String,
|
||||
pub asset_id: String,
|
||||
pub asset_kind: KernelProjectionAssetKind,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum KernelGraphDirection {
|
||||
@@ -367,6 +399,10 @@ pub struct KernelProjectionResourceMeta {
|
||||
pub workspace_id: Option<String>,
|
||||
pub asset_kind: Option<KernelProjectionAssetKind>,
|
||||
pub icon_hint: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub object_identity: Option<KernelObjectIdentity>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub block_asset_relation: Option<KernelBlockAssetRelation>,
|
||||
#[serde(default)]
|
||||
pub extra: BTreeMap<String, Value>,
|
||||
}
|
||||
@@ -649,6 +685,8 @@ mod tests {
|
||||
workspace_id: Some("ws_1".into()),
|
||||
asset_kind: Some(KernelProjectionAssetKind::File),
|
||||
icon_hint: Some("page".into()),
|
||||
object_identity: None,
|
||||
block_asset_relation: None,
|
||||
extra: BTreeMap::new(),
|
||||
}),
|
||||
icon_hint: Some("page".into()),
|
||||
|
||||
Reference in New Issue
Block a user