From 0354afee4fcc4ca40a8728b1eaba01df1737ab2b Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Wed, 19 Mar 2025 22:53:51 +0000 Subject: [PATCH] Update code in endpoints/book.get.py --- endpoints/book.get.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/endpoints/book.get.py b/endpoints/book.get.py index e69de29..e553739 100644 --- a/endpoints/book.get.py +++ b/endpoints/book.get.py @@ -0,0 +1,32 @@ +from fastapi import APIRouter, Depends, HTTPException +from core.database import fake_users_db + +router = APIRouter() + +@router.get("/book") +async def book_handler(): + """Get book information demo endpoint""" + books = { + "1": { + "id": "1", + "title": "Demo Book 1", + "author": "John Doe", + "year": 2023 + }, + "2": { + "id": "2", + "title": "Demo Book 2", + "author": "Jane Smith", + "year": 2022 + } + } + + return { + "message": "Books retrieved successfully", + "data": list(books.values()), + "metadata": { + "total_count": len(books), + "source": "demo_books_db", + "timestamp": "2024-01-01T00:00:00Z" + } + } \ No newline at end of file