25 lines
758 B
Python
25 lines
758 B
Python
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"
|
|
}
|
|
} |