85 lines
2 KiB
Text
85 lines
2 KiB
Text
@startuml Folder Structure
|
|
|
|
package "MongoDB Collection: folders" {
|
|
|
|
object "Root Folder" as root {
|
|
_id = "root_abc123"
|
|
name = "__root__"
|
|
parents = []
|
|
objects = []
|
|
owner_id = "123456"
|
|
owner_name = "user@example.com"
|
|
root = true
|
|
}
|
|
|
|
object "Folder: Office" as office {
|
|
_id = "folder_office_xyz"
|
|
name = "Office"
|
|
parents = ["root_abc123"]
|
|
objects = [
|
|
{object_type: "camera", object_id: "cam_1"},
|
|
{object_type: "camera", object_id: "cam_2"}
|
|
]
|
|
owner_id = "123456"
|
|
}
|
|
|
|
object "Folder: Warehouse" as warehouse {
|
|
_id = "folder_warehouse_qwe"
|
|
name = "Warehouse"
|
|
parents = ["root_abc123"]
|
|
objects = [
|
|
{object_type: "camera", object_id: "cam_3"},
|
|
{object_type: "server", object_id: "srv_1"}
|
|
]
|
|
owner_id = "123456"
|
|
}
|
|
|
|
object "Subfolder: Entrance" as entrance {
|
|
_id = "folder_entrance_asd"
|
|
name = "Entrance"
|
|
parents = ["root_abc123", "folder_office_xyz"]
|
|
objects = [
|
|
{object_type: "camera", object_id: "cam_4"}
|
|
]
|
|
owner_id = "123456"
|
|
}
|
|
}
|
|
|
|
object "User" as user {
|
|
_id = 123456
|
|
login = "user@example.com"
|
|
root_folder = "root_abc123"
|
|
}
|
|
|
|
user --> root : root_folder
|
|
root --> office : subfolder
|
|
root --> warehouse : subfolder
|
|
office --> entrance : subfolder
|
|
|
|
note right of root
|
|
При создании пользователя
|
|
создается пустая root_folder
|
|
|
|
objects = []
|
|
parents = []
|
|
root = true
|
|
end note
|
|
|
|
note right of office
|
|
Пользователь может создавать
|
|
папки для организации камер:
|
|
- Офис
|
|
- Склад
|
|
- Парковка
|
|
и т.д.
|
|
end note
|
|
|
|
note right of entrance
|
|
Поддерживается вложенность:
|
|
parents = [root, office]
|
|
|
|
Уровень вложенности:
|
|
level = len(parents) = 2
|
|
end note
|
|
|
|
@enduml
|