mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
16 lines
412 B
Python
16 lines
412 B
Python
from fastapi import APIRouter, Depends, status
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.database import get_db
|
|
from app.models.shakespeare import Paragraph
|
|
|
|
router = APIRouter(prefix="/v1/shakespeare")
|
|
|
|
|
|
@router.get("/",)
|
|
async def find_paragraph(
|
|
character: str,
|
|
db_session: AsyncSession = Depends(get_db),
|
|
):
|
|
return await Paragraph.find(db_session=db_session, character=character)
|