Update code in endpoints/endpoint.get.py

This commit is contained in:
Backend IM Bot 2025-03-28 19:21:39 +00:00
parent 8094e6fd16
commit 2bd3de565e

View File

@ -1,20 +1,11 @@
from fastapi import APIRouter, status from fastapi import APIRouter, status
from typing import Dict from typing import Dict
import random
router = APIRouter() router = APIRouter()
@router.get("/endpoint", status_code=status.HTTP_200_OK, response_model=Dict[str, str]) @router.get("/endpoint", status_code=status.HTTP_200_OK, response_model=Dict[str, str])
async def get_dave_translations(): async def get_random_color():
translations = { """Generate a random color"""
"english": "Dave", color = '#{:06x}'.format(random.randint(0, 0xFFFFFF))
"spanish": "David", return {"color": color}
"french": "David",
"german": "David",
"italian": "Davide",
"portuguese": "Davi",
"russian": "Давид",
"japanese": "デイビッド",
"chinese": "戴夫",
"korean": "데이비드"
}
return translations