Update code in endpoints/api/v1/endpoint.get.py

This commit is contained in:
Backend IM Bot 2025-03-19 17:13:21 +00:00
parent 0183fa43fc
commit 58c7699b40

View File

@ -1,41 +1,30 @@
from fastapi import APIRouter, Depends, HTTPException
from core.database import fake_users_db
from typing import Dict, List
router = APIRouter()
@router.get("/api/v1/endpoint")
async def get_dummy_data():
"""Get dummy data endpoint"""
dummy_data = {
"users": [
{
"id": "001",
"name": "John Doe",
"email": "john@example.com",
"role": "user"
},
{
"id": "002",
"name": "Jane Smith",
"email": "jane@example.com",
"role": "admin"
}
{"id": "1", "name": "John Doe", "role": "admin"},
{"id": "2", "name": "Jane Smith", "role": "user"},
{"id": "3", "name": "Bob Johnson", "role": "user"}
],
"stats": {
"total_users": 2,
"active_users": 1,
"last_updated": "2024-01-01T00:00:00Z"
"settings": {
"theme": "dark",
"notifications": True,
"language": "en"
}
}
return {
"message": "Data retrieved successfully",
"message": "Dummy data retrieved successfully",
"data": dummy_data,
"metadata": {
"source": "demo_database",
"version": "1.0",
"timestamp": "2024-01-01T00:00:00Z"
"timestamp": "2024-01-01T00:00:00Z",
"source": "demo_database"
}
}