Files
xiaoxia-saas/apps/api/app/schemas/upload.py
T
Xiaoxia AI 1d638027bf
Deploy / Build Production Runtime Images (push) Successful in 8m58s
Deploy / Deploy Production (push) Successful in 1m7s
Deploy / Production Browser E2E (push) Failing after 4m17s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
feat(upload): add OSS direct upload flow
2026-06-23 15:47:03 +08:00

38 lines
1.1 KiB
Python

from pydantic import BaseModel, Field
class UploadAssetResponse(BaseModel):
storage_key: str
ingest_job_id: str
url: str = Field(..., description="Public URL of uploaded file")
class DirectUploadPrepareRequest(BaseModel):
workspace_id: str = Field(..., min_length=1)
project_id: str = Field(..., min_length=1)
library_id: str = Field(..., min_length=1)
filename: str = Field(..., min_length=1, max_length=255)
content_type: str = Field(default="application/octet-stream", min_length=1, max_length=100)
file_size: int = Field(..., gt=0)
class DirectUploadPrepareResponse(BaseModel):
upload_url: str
method: str
storage_key: str
expires_at: str
fields: dict[str, str]
max_size_bytes: int
class DirectUploadCompleteRequest(BaseModel):
workspace_id: str = Field(..., min_length=1)
project_id: str = Field(..., min_length=1)
library_id: str = Field(..., min_length=1)
storage_key: str = Field(..., min_length=1, max_length=255)
class DirectUploadCompleteResponse(BaseModel):
storage_key: str
ingest_job_id: str