refactor: 优化响应格式和错误处理 fix: 修复文件上传类型校验和删除无用PDF文件 perf: 添加估值评估审核时间字段和查询条件 docs: 更新Docker镜像版本至v1.8 test: 添加响应格式检查脚本 style: 统一API响应数据结构 chore: 清理无用静态文件和更新构建脚本
12 lines
557 B
Python
12 lines
557 B
Python
from fastapi import APIRouter, UploadFile, File
|
|
from app.controllers.upload import UploadController
|
|
from app.schemas.upload import ImageUploadResponse, FileUploadResponse
|
|
from app.schemas.base import BasicResponse, Success
|
|
|
|
router = APIRouter()
|
|
|
|
@router.post("/file", response_model=BasicResponse[dict], summary="统一上传接口")
|
|
async def upload(file: UploadFile = File(...)) -> BasicResponse[dict]:
|
|
res = await UploadController.upload_any(file)
|
|
return Success(data={"url": res.url, "filename": res.filename, "content_type": res.content_type})
|