Files
thisORthat/app/schemas/api_schemas.py
T
IgorVolochay 99867cef80 feat: creating FastAPI routes for working with cards
Added 3 routes:
- add_card (add a card via POST request with AddCardBody scheme)
- get_card (get a specific card by card_id)
- get_random_cards (get 10 random cards)
2025-02-25 19:11:35 +03:00

22 lines
375 B
Python

import typing
from pydantic import BaseModel, NonNegativeInt
class BaseResponse(BaseModel):
result: typing.Any
error: bool = False
class AddUserBody(BaseModel):
user_id: NonNegativeInt
username: str
first_name: str
last_name: str
photo_url: str
class AddCardBody(BaseModel):
choice_A: str
choice_B: str
author_id: NonNegativeInt