demo version prepped

This commit is contained in:
2026-04-01 12:40:40 -04:00
parent d44e5f0ad1
commit ed319a6423
62 changed files with 8362 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
from fastapi import APIRouter
import database as db
from typing import Any
from logger import get_logger
logger = get_logger(__name__)
router = APIRouter(prefix="/cellsites", tags=["cellsites"])
@router.get("/")
def get_cellsites() -> list[dict[Any, Any]]: # type: ignore
conn = db.connect_to_db()
try:
with db.connect_to_db() as conn:
return db.get_cellsites(conn)
except Exception as e:
logger.error(f"Error fetching cellsites: {e}", exc_info=True)
return []
finally:
conn.close()
@router.get("/{id}")
def get_cellsite(id: int) -> list[dict[str, Any]]: # type: ignore
conn = db.connect_to_db()
try:
with db.connect_to_db() as conn:
return db.get_cellsite(conn, id)
except Exception as e:
logger.error(f"Error fetching cellsite {id}: {e}", exc_info=True)
return []
finally:
conn.close()