1
This commit is contained in:
34
backend/app/schemas.py
Normal file
34
backend/app/schemas.py
Normal file
@@ -0,0 +1,34 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class MindmapNode(BaseModel):
|
||||
id: str
|
||||
label: str
|
||||
parent_id: str | None = None
|
||||
level: int
|
||||
is_leaf: bool
|
||||
children: list["MindmapNode"] = Field(default_factory=list)
|
||||
|
||||
|
||||
MindmapNode.model_rebuild()
|
||||
|
||||
|
||||
class MindmapCreateRequest(BaseModel):
|
||||
session_id: str = Field(min_length=1, max_length=255)
|
||||
mindmap_json: dict
|
||||
|
||||
|
||||
class MindmapResponse(BaseModel):
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
id: int
|
||||
unique_id: str
|
||||
session_id: str
|
||||
title: str
|
||||
raw_json: str
|
||||
tree: MindmapNode
|
||||
url: str
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
Reference in New Issue
Block a user