diff --git a/app/api/models.py b/app/api/models.py new file mode 100644 index 0000000..35afedb --- /dev/null +++ b/app/api/models.py @@ -0,0 +1,15 @@ +from dataclasses import dataclass +from typing import List + + +@dataclass +class Request: + build_id: str + build_url: str + commit_id: str + commit_url: str + changelist: List[str] + +@dataclass +class Response: + status: int diff --git a/app/api/v1.py b/app/api/v1.py index 1cd9f50..fc52bd4 100644 --- a/app/api/v1.py +++ b/app/api/v1.py @@ -1,8 +1,19 @@ from fastapi import APIRouter +from app.api.models import Request, Response + router = APIRouter() @router.get("/", summary="Main API") async def root(): - return {"message": "Witaj w API v12"} + return {"message": "Witaj w API v1"} + + +@router.get("/health", summary="Health check") +async def health(): + return {"status": "ok"} + +@router.post("/ci", summary="CI Webhook") +async def ci(request: Request): + return Response(200) diff --git a/app/services/ci.py b/app/services/ci.py deleted file mode 100644 index e69de29..0000000