From 902e1e8244800ccd567e22f8a44129fa3eb0c595 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Wed, 19 Mar 2025 18:05:22 +0000 Subject: [PATCH] Update code in endpoints/post-endpoint.post.py --- endpoints/post-endpoint.post.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/endpoints/post-endpoint.post.py b/endpoints/post-endpoint.post.py index e69de29..c840e6c 100644 --- a/endpoints/post-endpoint.post.py +++ b/endpoints/post-endpoint.post.py @@ -0,0 +1,27 @@ +from fastapi import APIRouter, Depends, HTTPException +from core.database import fake_users_db +from pydantic import BaseModel + +router = APIRouter() + +class WordInput(BaseModel): + word: str + +@router.post("/post-endpoint") +async def append_car_handler( + input_data: WordInput +): + """Append 'car' to input word""" + result = f"{input_data.word}car" + + return { + "message": "Word processed successfully", + "data": { + "original_word": input_data.word, + "modified_word": result + }, + "metadata": { + "operation": "append", + "append_value": "car" + } + } \ No newline at end of file