From d26a75ebcc4aa37211983082dc4229149ee7f951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Wed, 6 Sep 2023 18:46:37 +0000 Subject: [PATCH] branch out "sandbox" stuff --- api/advent22_api/routers/__init__.py | 3 +- api/advent22_api/routers/abspacken.py | 57 --------------------------- 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 api/advent22_api/routers/abspacken.py diff --git a/api/advent22_api/routers/__init__.py b/api/advent22_api/routers/__init__.py index 867db6b..69183a0 100644 --- a/api/advent22_api/routers/__init__.py +++ b/api/advent22_api/routers/__init__.py @@ -1,10 +1,9 @@ from fastapi import APIRouter -from . import abspacken, days, general, user +from . import days, general, user router = APIRouter(prefix="/api") -router.include_router(abspacken.router) router.include_router(days.router) router.include_router(general.router) router.include_router(user.router) diff --git a/api/advent22_api/routers/abspacken.py b/api/advent22_api/routers/abspacken.py deleted file mode 100644 index 3451c27..0000000 --- a/api/advent22_api/routers/abspacken.py +++ /dev/null @@ -1,57 +0,0 @@ -import asyncio - -from fastapi import APIRouter, Depends, HTTPException, status - -from .user import require_admin - -router = APIRouter(prefix="/abspacken", tags=["abspacken"]) - - -async def get_kurix(kgs: float) -> float: - # die berechnung ist sehr aufwändig, braucht lange! - await asyncio.sleep(2) - - return kgs / 1.13 - - -@router.post("/uwe") -async def uwe( - kgs: float = 10, - firma: str = "Vodafone", - _: None = Depends(require_admin), -) -> 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 f"Der Alphakevin Torsten hat ein langes {ding}." - - -@router.get( - "/kys", - responses={ - status.HTTP_200_OK: { - "description": "Einfach NEIN", - "content": None, - }, - status.HTTP_418_IM_A_TEAPOT: { - "description": "Commit Sudoku", - "content": None, - }, - }, -) -async def kys() -> None: - """ - Heiße Botschaften aus der Nachbarschaft warten auf Sie. - - Also:
- Sinnlose Todesdrohungen und Synapsenfasching. - """ - - raise HTTPException(status.HTTP_418_IM_A_TEAPOT, "Go kill yourself")