from fastapi import APIRouter, Depends, HTTPException from services.points_of_interest_service import PointsOfInterestService from models.schemas import PointOfInterest from config.database import get_db router = APIRouter() @router.post("/", status_code=201) async def create_point(point: PointOfInterest, db=Depends(get_db)): return await PointsOfInterestService.create_point_of_interest(point, db) @router.get("/{point_id}") async def get_point(point_id: int, db=Depends(get_db)): return await PointsOfInterestService.get_point_of_interest(point_id, db) @router.get("/") async def get_all_points(db=Depends(get_db)): return await PointsOfInterestService.get_all_points_of_interest(db) @router.put("/{point_id}") async def update_point(point_id: int, data: dict, db=Depends(get_db)): return await PointsOfInterestService.update_point_of_interest(point_id, data, db) @router.delete("/{point_id}") async def delete_point(point_id: int, db=Depends(get_db)): return await PointsOfInterestService.delete_point_of_interest(point_id, db)