Реализовать лабораторную работу 2

This commit is contained in:
2026-10-18 15:53:16 +03:00
parent 65003b6119
commit be7a90132b
48 changed files with 1921 additions and 23 deletions
+14
View File
@@ -0,0 +1,14 @@
from fastapi import APIRouter, Request
from app.api.serialize import user_out
from app.core.security import hash_password
from app.schemas import CreateUser
router = APIRouter()
@router.post('/api/v1/users', status_code=201)
async def register(body: CreateUser, request: Request):
row = await request.app.state.storage.create_user(
body.username, body.display_name, hash_password(body.password))
return user_out(row)