66 lines
2.3 KiB
Python
66 lines
2.3 KiB
Python
from __future__ import annotations
|
||
|
||
from datetime import datetime
|
||
|
||
from pydantic import BaseModel, ConfigDict, Field
|
||
|
||
|
||
class VpV3ProjectCreate(BaseModel):
|
||
"""创建虚拟素材项目请求。"""
|
||
|
||
name: str = Field(..., min_length=1, max_length=100, description="项目名称,1-100 字符")
|
||
description: str | None = Field(None, max_length=500, description="项目描述,最多 500 字符")
|
||
|
||
|
||
class VpV3ProjectUpdate(BaseModel):
|
||
"""更新虚拟素材项目请求。"""
|
||
|
||
name: str | None = Field(None, min_length=1, max_length=100, description="项目名称,1-100 字符")
|
||
description: str | None = Field(None, max_length=500, description="项目描述,最多 500 字符")
|
||
|
||
|
||
class VpV3ProjectOut(BaseModel):
|
||
"""虚拟素材项目详情响应。"""
|
||
|
||
model_config = ConfigDict(extra="ignore")
|
||
|
||
project_id: str = Field(description="项目 ID")
|
||
name: str = Field(description="项目名称")
|
||
description: str | None = Field(None, description="项目描述")
|
||
status: str = Field(description="项目状态")
|
||
|
||
# 计数
|
||
asset_count: int = Field(0, description="素材总数(含失败、删除中)")
|
||
active_asset_count: int = Field(0, description="可用素材数(status=active)")
|
||
image_asset_count: int = Field(0, description="图片素材数")
|
||
video_asset_count: int = Field(0, description="视频素材数")
|
||
storage_mb_used: float = Field(0, description="已占用存储 MB")
|
||
|
||
remote_delete_status: str = Field("none", description="远端删除状态")
|
||
error_message: str | None = Field(None, description="最近一次错误信息")
|
||
|
||
created_at: datetime = Field(description="创建时间")
|
||
updated_at: datetime = Field(description="最后更新时间")
|
||
|
||
|
||
class VpV3ProjectListOut(BaseModel):
|
||
"""虚拟素材项目列表响应。"""
|
||
|
||
items: list[VpV3ProjectOut] = Field(default_factory=list)
|
||
total: int = Field(0, description="总数")
|
||
page: int = Field(1, ge=1, description="当前页码")
|
||
page_size: int = Field(20, ge=1, description="每页数量")
|
||
|
||
|
||
class VpV3ProjectDeleteOut(BaseModel):
|
||
"""删除响应。"""
|
||
|
||
success: bool = Field(True)
|
||
remote_delete_status: str = Field(description="远端删除状态:none/pending/...")
|
||
|
||
|
||
class VpV3IdOut(BaseModel):
|
||
"""创建接口的简单 ID 响应。"""
|
||
|
||
Id: str = Field(description="资源 ID")
|