Restructure backend and frontend modules; add story, library, and editor schema migrations. Support editable automatic production, manual confirmation modes, account and user lifecycle management, compact container scrolling, consistent forms, and per-task result previews. Update inference and TTS scheduling, deployment guidance, and regression coverage; remove obsolete standalone pages and temporary acceptance artifacts.
35 lines
977 B
Python
35 lines
977 B
Python
from typing import Literal
|
|
from pydantic import BaseModel, Field, field_validator
|
|
|
|
|
|
class FolderCreate(BaseModel):
|
|
name: str = Field(min_length=1, max_length=255)
|
|
parent_id: str | None = None
|
|
|
|
@field_validator("name")
|
|
@classmethod
|
|
def clean_name(cls, value):
|
|
value = value.strip()
|
|
if not value:
|
|
raise ValueError("文件夹名称不能为空")
|
|
return value
|
|
|
|
|
|
class FolderPatch(BaseModel):
|
|
name: str | None = Field(default=None, min_length=1, max_length=255)
|
|
parent_id: str | None = None
|
|
|
|
@field_validator("name")
|
|
@classmethod
|
|
def clean_name(cls, value):
|
|
if value is None or not value.strip():
|
|
raise ValueError("文件夹名称不能为空")
|
|
return value.strip()
|
|
|
|
|
|
class FolderAssign(BaseModel):
|
|
kind: Literal["assets", "jobs", "drafts", "runs"]
|
|
ids: list[str] = Field(min_length=1, max_length=200)
|
|
folder_id: str | None
|
|
mode: Literal["move", "add"] = "move"
|