29 lines
733 B
Python
29 lines
733 B
Python
from fastapi import APIRouter, HTTPException
|
|
|
|
users = [] # In-memory storage
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/profile")
|
|
async def get_profile(
|
|
firstname: str = "John",
|
|
lastname: str = "Doe",
|
|
email: str = "john@example.com"
|
|
):
|
|
"""Get user profile endpoint"""
|
|
user = next((u for u in users if u["email"] == email), None)
|
|
if not user:
|
|
raise HTTPException(status_code=404, detail="Profile not found")
|
|
|
|
return {
|
|
"message": "Profile retrieved successfully",
|
|
"user": {
|
|
"firstname": firstname,
|
|
"lastname": lastname,
|
|
"email": email
|
|
},
|
|
"features": {
|
|
"profile_complete": True,
|
|
"verified": False
|
|
}
|
|
} |