28 lines
600 B
Python
28 lines
600 B
Python
|
import asyncio
|
||
|
|
||
|
from fastapi import APIRouter
|
||
|
|
||
|
router = APIRouter(prefix="/abspacken", tags=["abspacken"])
|
||
|
|
||
|
|
||
|
async def get_kurix(kgs: float) -> float:
|
||
|
await asyncio.sleep(2)
|
||
|
|
||
|
return kgs / 1.13
|
||
|
|
||
|
|
||
|
@router.post("/uwe")
|
||
|
async def uwe(
|
||
|
kgs: float = 10,
|
||
|
firma: str = "Vodafone"
|
||
|
) -> str:
|
||
|
kurix = await get_kurix(kgs)
|
||
|
|
||
|
return f"UWE hat bei {firma} einen beachtlichen Haufen von " \
|
||
|
f"{kgs} Kg ({kurix:.3f} Kurix) auf den Läufer geschissen."
|
||
|
|
||
|
|
||
|
@router.get("/torsten/{ding}")
|
||
|
async def torsten(ding: str) -> str:
|
||
|
return "Der Alphakevin Torsten hat ein " f"langes {ding}."
|