initial commit for GitHub
This commit is contained in:
20
server/app/routers/quotes.py
Normal file
20
server/app/routers/quotes.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.controller import controller
|
||||
from app.model import Quote
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/quotes",
|
||||
tags=["quotes"],
|
||||
responses={404: {"description": "Not found"}},
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def all_quotes() -> list[Quote]:
|
||||
return await controller.get_all_quotes()
|
||||
|
||||
|
||||
@router.get("/{id}")
|
||||
async def quote(id: int) -> Quote:
|
||||
return controller.get_one_quote(id)
|
||||
Reference in New Issue
Block a user