Mayank Chugh commited on
Commit ·
a26f62e
1
Parent(s): fa1e61a
Add Milestone 2 with route skeletons and update main.py to include new routes. Enhance health check response with app details.
Browse files- api/main.py +8 -2
- api/routes/__init__.py +0 -0
- api/routes/audit.py +11 -0
- api/routes/ingest.py +11 -0
- api/routes/jobs.py +11 -0
- api/routes/query.py +11 -0
api/main.py
CHANGED
|
@@ -1,7 +1,13 @@
|
|
| 1 |
from fastapi import FastAPI
|
|
|
|
| 2 |
|
| 3 |
app = FastAPI()
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
def health() -> dict[str, str]:
|
| 7 |
-
return {"status": "ok"}
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from .routes import audit, ingest, jobs, query
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
+
app.include_router(audit.router)
|
| 7 |
+
app.include_router(ingest.router)
|
| 8 |
+
app.include_router(jobs.router)
|
| 9 |
+
app.include_router(query.router)
|
| 10 |
+
|
| 11 |
+
@app.get("/health", tags=["Health"])
|
| 12 |
def health() -> dict[str, str]:
|
| 13 |
+
return {"status": "ok","app_name": "doc-audi-ai", "version": "0.1.0"}
|
api/routes/__init__.py
ADDED
|
File without changes
|
api/routes/audit.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
|
| 3 |
+
router = APIRouter(prefix="/audit", tags=["audit"])
|
| 4 |
+
|
| 5 |
+
@router.get("/audit")
|
| 6 |
+
def audit_placeholder() -> dict[str, str | list]:
|
| 7 |
+
return {
|
| 8 |
+
"status": "placeholder",
|
| 9 |
+
"message": "Audit not implemented yet.",
|
| 10 |
+
"results": [],
|
| 11 |
+
}
|
api/routes/ingest.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
|
| 3 |
+
router = APIRouter(prefix="/ingest", tags=["ingest"])
|
| 4 |
+
|
| 5 |
+
@router.post("/upload")
|
| 6 |
+
def upload_placeholder() -> dict[str, str | list]:
|
| 7 |
+
return {
|
| 8 |
+
"status": "placeholder",
|
| 9 |
+
"message": "Upload not implemented yet.",
|
| 10 |
+
"results": [],
|
| 11 |
+
}
|
api/routes/jobs.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
|
| 3 |
+
router = APIRouter(prefix="/jobs", tags=["jobs"])
|
| 4 |
+
|
| 5 |
+
@router.get("/jobs")
|
| 6 |
+
def jobs_placeholder() -> dict[str, str | list]:
|
| 7 |
+
return {
|
| 8 |
+
"status": "placeholder",
|
| 9 |
+
"message": "Jobs not implemented yet.",
|
| 10 |
+
"results": [],
|
| 11 |
+
}
|
api/routes/query.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import APIRouter
|
| 2 |
+
|
| 3 |
+
router = APIRouter(prefix="/query", tags=["query"])
|
| 4 |
+
|
| 5 |
+
@router.post("/query")
|
| 6 |
+
def query_placeholder() -> dict[str, str | list]:
|
| 7 |
+
return {
|
| 8 |
+
"status": "placeholder",
|
| 9 |
+
"message": "Query not implemented yet.",
|
| 10 |
+
"results": [],
|
| 11 |
+
}
|