Files
files/README.md
Grendgi f591446422
Some checks failed
CI / hygiene (push) Successful in 2s
Build and Deploy / build-and-deploy (push) Failing after 2m22s
CI / test (push) Successful in 31s
docs: fix files proxy path
2026-06-16 12:51:05 +03:00

36 lines
1.6 KiB
Markdown

# Files Service
Единый сервис файлов Portal: папки, документы Office, Google-ссылки, PDF/медиа, доступы и временные ссылки.
## Что уже заложено
- `files_nodes` — дерево папок и файлов.
- `files_access` — прямой доступ `view/edit`, наследуется от родительских папок.
- `files_public_links` — временные ссылки на просмотр/скачивание.
- MinIO-хранилище для бинарных файлов.
- InternalAuth через Portal (`X-Internal-Key`, `X-User-Id`).
## Основные API
- `GET /api/nodes?scope=my|shared&parent_id=<uuid>`
- `POST /api/folders`
- `POST /api/files` multipart: `file`, `parent_id`, `title`
- `GET /api/nodes/{id}`
- `PATCH /api/nodes/{id}`
- `DELETE /api/nodes/{id}`
- `GET /api/nodes/{id}/download`
- `GET /api/nodes/{id}/access`
- `PUT /api/nodes/{id}/access`
- `POST /api/nodes/{id}/public-links`
- `GET /public/{token}` внутри сервиса
- `GET /public/{token}/download` внутри сервиса
- `GET /api/files/public/{token}` через Portal proxy
- `GET /api/files/public/{token}/download` через Portal proxy
## Миграционный путь
1. Подключить proxy Portal `/api/files/*` к этому сервису.
2. Сделать новый UI `Файлы`: `Мои файлы` и `Доступные мне`.
3. Перенести старые `office_documents` и `google_sheets` в `files_nodes`.
4. После проверки выключить старые `/api/office` и `/api/sheets`.