27 lines
640 B
Python
27 lines
640 B
Python
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"
|
|
}
|
|
} |