Add GET endpoint for /num

This commit is contained in:
Backend IM Bot 2025-03-27 20:53:51 +00:00
parent 3f797385ad
commit abd6ab78e3

View File

@ -0,0 +1,12 @@
# Entity: RandomNumber
from fastapi import APIRouter, status
from typing import Dict
import random
router = APIRouter()
@router.get("/num", status_code=200, response_model=Dict[str, int])
async def get_random_number():
"""Get a random number"""
return {"number": random.randint(1, 100)}