Update code in endpoints/yellow.post.py
This commit is contained in:
parent
f5106c3693
commit
65e7e1ef0a
@ -0,0 +1,38 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.post("/yellow")
|
||||||
|
async def yellow_handler(
|
||||||
|
name: str = "default_name",
|
||||||
|
color: str = "yellow",
|
||||||
|
size: int = 10
|
||||||
|
):
|
||||||
|
"""Demo yellow endpoint"""
|
||||||
|
item_id = str(uuid.uuid4())
|
||||||
|
|
||||||
|
new_item = {
|
||||||
|
"id": item_id,
|
||||||
|
"name": name,
|
||||||
|
"color": color,
|
||||||
|
"size": size,
|
||||||
|
"created_at": "2024-01-01T00:00:00Z"
|
||||||
|
}
|
||||||
|
|
||||||
|
fake_users_db[item_id] = new_item
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "Yellow item created successfully",
|
||||||
|
"data": new_item,
|
||||||
|
"metadata": {
|
||||||
|
"status": "active",
|
||||||
|
"version": "1.0",
|
||||||
|
"created_by": "system"
|
||||||
|
},
|
||||||
|
"next_steps": [
|
||||||
|
"Configure item properties",
|
||||||
|
"Add to collection"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user