Update code in endpoints/api/v1/endpoint.post.py
This commit is contained in:
parent
20c5b69870
commit
56bb3231c6
24
endpoints/api/v1/endpoint.post.py
Normal file
24
endpoints/api/v1/endpoint.post.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
import random
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.post("/endpoint")
|
||||||
|
async def get_random_number():
|
||||||
|
"""Generate a random number"""
|
||||||
|
random_number = random.randint(1, 1000)
|
||||||
|
|
||||||
|
return {
|
||||||
|
"message": "Random number generated successfully",
|
||||||
|
"data": {
|
||||||
|
"number": random_number
|
||||||
|
},
|
||||||
|
"metadata": {
|
||||||
|
"range": {
|
||||||
|
"min": 1,
|
||||||
|
"max": 1000
|
||||||
|
},
|
||||||
|
"generated_at": "demo"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user