Files
mtusi2026lab4-fork/app/schemas.py
daniil_sobolev 747ca222e5 Implement lab4 attachments on RustFS for grade 4.
Carry over lab3 HA stack and add private S3 storage, Attachment API, orphan compensation/reaper, own tests, and evidence for smoke/persistence/failover.
2026-11-12 20:41:02 +03:00

31 lines
938 B
Python

"""Схемы тел запросов для 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=["Привет, Боб!"])
attachment_ids: List[str] = Field(default_factory=list)