Lab2: PostgreSQL, Bearer sessions and Redis for grade 4

This commit is contained in:
2026-10-29 01:25:40 +03:00
parent 65003b6119
commit 3c5af42f24
35 changed files with 2126 additions and 25 deletions
+28
View File
@@ -0,0 +1,28 @@
"""Схемы тел запросов для OpenAPI / Swagger (валидация домена — в services)."""
from typing import List
from pydantic import BaseModel, ConfigDict, Field
class CreateUserBody(BaseModel):
model_config = ConfigDict(extra="forbid")
username: str = Field(..., examples=["alice"])
display_name: str = Field(..., examples=["Алиса"])
password: str = Field(..., examples=["Example-only-not-a-real-secret-123"])
class CreateChatBody(BaseModel):
model_config = ConfigDict(extra="forbid")
title: str = Field(..., examples=["Проект по ВНП"])
member_ids: List[str] = Field(
...,
examples=[["11111111-1111-4111-8111-111111111111"]],
)
class CreateMessageBody(BaseModel):
model_config = ConfigDict(extra="forbid")
text: str = Field(..., examples=["Привет, Боб!"])