Update code in endpoints/api/long-description.post.py
This commit is contained in:
parent
faf250dad5
commit
99be160112
35
endpoints/api/long-description.post.py
Normal file
35
endpoints/api/long-description.post.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.post("/api/long-description")
|
||||||
|
async def long_description_handler(
|
||||||
|
content: str = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
|
||||||
|
):
|
||||||
|
"""Handle very long description demo endpoint"""
|
||||||
|
request_id = str(uuid.uuid4())
|
||||||
|
|
||||||
|
if len(content) < 100:
|
||||||
|
raise HTTPException(status_code=400, detail="Content must be at least 100 characters long")
|
||||||
|
|
||||||
|
fake_users_db[request_id] = {
|
||||||
|
"id": request_id,
|
||||||
|
"content": content,
|
||||||
|
"length": len(content),
|
||||||
|
"timestamp": "2024-01-01T00:00:00Z"
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "Long description processed successfully",
|
||||||
|
"request_id": request_id,
|
||||||
|
"stats": {
|
||||||
|
"content_length": len(content),
|
||||||
|
"processed_at": "2024-01-01T00:00:00Z"
|
||||||
|
},
|
||||||
|
"next_steps": [
|
||||||
|
"Review processed content",
|
||||||
|
"Check content statistics"
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user