8064b64ff5
1. 修正上传端点schema命名:新增UploadAssetRequest模型替代自动生成的Body_upload_asset名称 2. 清理认证重复端点:移除/forgot-password和/reset-password旧路由,保留/password/forgot和/password/reset 3. 清理workspace_id残留:从edit_plan/asset_diagnosis/task_center/project_title等schema中移除,project_management和projects中改为可选 4. 更新README:移除过时的多租户/订阅/refresh token描述,修正仓库地址为git.xiaoxiajianji.com,更新API路径列表
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
from pydantic import BaseModel, Field
|
||
|
||
|
||
|
||
class UploadAssetRequest(BaseModel):
|
||
"""素材上传请求(multipart form)"""
|
||
project_id: str = Field(..., min_length=1, description="项目 ID")
|
||
library_id: str = Field(..., min_length=1, description="素材库 ID")
|
||
workspace_id: str = Field(default="", description="工作空间 ID(已废弃,可传空)")
|
||
|
||
class UploadAssetResponse(BaseModel):
|
||
storage_key: str
|
||
ingest_job_id: str
|
||
url: str = Field(..., description="Public URL of uploaded file")
|
||
|
||
|
||
class DirectUploadPrepareRequest(BaseModel):
|
||
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):
|
||
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
|