Перенести реализацию мессенджера из ЛР 6

Файлы скопированы без изменений из solution/BPI2301-Vozzhin
репозитория mtusi2026lab6. Доработки ЛР 7 идут отдельными коммитами.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-12-03 19:48:41 +05:00
co-authored by Claude Opus 5.5
parent 20afc2c790
commit 31d441184b
92 changed files with 6153 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
from fastapi import APIRouter, Depends
from ...domain.models import User
from ...services.users import UserService
from ..deps import current_user, user_service
from ..schemas import CreateUser, UserOut
router = APIRouter(prefix='/api/v1', tags=['users'])
@router.post('/users', status_code=201, response_model=UserOut)
async def register(body: CreateUser, users: UserService = Depends(user_service)) -> UserOut:
return UserOut.from_domain(await users.register(body.username, body.display_name, body.password))
@router.get('/users/me', response_model=UserOut)
async def me(actor: User = Depends(current_user)) -> UserOut:
return UserOut.from_domain(actor)