Update code in endpoints/get-endpoint.get.py

This commit is contained in:
Backend IM Bot 2025-03-19 18:00:46 +00:00
parent 66165e15f2
commit 783a787915

View File

@ -0,0 +1,25 @@
from fastapi import APIRouter, Depends, HTTPException
from core.database import fake_users_db
router = APIRouter()
@router.get("/get-fruits")
async def get_fruits_handler():
"""Get list of available fruits"""
fruits = [
{"id": 1, "name": "Apple", "color": "Red"},
{"id": 2, "name": "Banana", "color": "Yellow"},
{"id": 3, "name": "Orange", "color": "Orange"},
{"id": 4, "name": "Grape", "color": "Purple"},
{"id": 5, "name": "Kiwi", "color": "Brown"}
]
return {
"message": "Fruits retrieved successfully",
"data": fruits,
"metadata": {
"total_count": len(fruits),
"source": "demo_database",
"last_updated": "2024-01-01"
}
}