- upload, metadata and download endpoints for PNG/JPEG attachments:
limits before reading and decompression, type by content,
structural integrity check without decoding pixels, safe filename
- write order: pending row with object key -> PUT to S3 -> ready;
per-step DB sessions so no pool connection is held during transfers
- attachment_ids in messages (validation, idempotency hash, history);
whitespace-only text allowed with an attachment (teacher, 2026-10-20)
- migration: attachments and message_attachments tables, text length
CHECK relaxed with NOT VALID
- student tests, fault checks and driver commands for attachments;
rollout profile starts from e1161f7 and checks the commit first
- sync attachments deltas into main specs; rules, AGENTS.md, PLAN.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
841 B
Python
27 lines
841 B
Python
"""Ручки API версии 1.
|
|
|
|
Каждый модуль пакета — роутер домена; здесь они собираются в
|
|
`v1_router` под `API_V1_PREFIX`. Новый домен регистрируется только тут.
|
|
"""
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from src.utils.constants import API_V1_PREFIX
|
|
|
|
from .attachment import router as attachment_router
|
|
from .chat import router as chat_router
|
|
from .message import router as message_router
|
|
from .session import router as session_router
|
|
from .user import router as user_router
|
|
|
|
v1_router = APIRouter(prefix=API_V1_PREFIX)
|
|
v1_router.include_router(user_router)
|
|
v1_router.include_router(session_router)
|
|
v1_router.include_router(chat_router)
|
|
v1_router.include_router(message_router)
|
|
v1_router.include_router(attachment_router)
|
|
|
|
__all__ = [
|
|
"v1_router",
|
|
]
|