14 lines
363 B
Python
14 lines
363 B
Python
import random
|
|
import string
|
|
|
|
from fastapi import APIRouter, HTTPException
|
|
|
|
router = APIRouter()
|
|
|
|
@router.post("/generate-selection-code", response_model=str)
|
|
async def generate_selection_code():
|
|
"""
|
|
Generate a random selection code
|
|
"""
|
|
selection_code = ''.join(random.choices(string.ascii_uppercase + string.digits, k=6))
|
|
return selection_code |