from fastapi import APIRouter, UploadFile, File
from app.controllers.upload import UploadController
from app.schemas.upload import ImageUploadResponse

router = APIRouter()

@router.post("/image", response_model=ImageUploadResponse, summary="上传图片")
async def upload_image(file: UploadFile = File(...)) -> ImageUploadResponse:
    """
    上传图片接口
    :param file: 图片文件
    :return: 图片URL和文件名
    """
    return await UploadController.upload_image(file)