52ff2f80ad
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Lint (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Build Production Runtime Images (push) Has been cancelled
Deploy / Deploy Production (push) Has been cancelled
Deploy / Production Browser E2E (push) Has been cancelled
48 lines
1.1 KiB
Python
48 lines
1.1 KiB
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ProjectTaskResponse(BaseModel):
|
|
id: str
|
|
task_type: str
|
|
project_id: str
|
|
status: str
|
|
progress: float
|
|
current_step: str
|
|
error_message: str = ""
|
|
user_message: str = ""
|
|
retryable: bool = False
|
|
source_id: str = ""
|
|
template_id: str = ""
|
|
created_at: datetime | None = None
|
|
updated_at: datetime | None = None
|
|
|
|
|
|
class ListProjectTasksResponse(BaseModel):
|
|
items: list[ProjectTaskResponse] = Field(default_factory=list)
|
|
|
|
|
|
class UserTaskResponse(BaseModel):
|
|
"""用户级任务响应(跨 project,用于模板模式)。"""
|
|
|
|
id: str
|
|
task_type: str
|
|
project_id: str = ""
|
|
template_id: str = ""
|
|
status: str
|
|
progress: float
|
|
current_step: str
|
|
error_message: str = ""
|
|
user_message: str = ""
|
|
retryable: bool = False
|
|
source_id: str = ""
|
|
created_at: datetime | None = None
|
|
updated_at: datetime | None = None
|
|
|
|
|
|
class ListTasksResponse(BaseModel):
|
|
"""用户级任务列表响应(GET /api/v1/tasks)。"""
|
|
|
|
items: list[UserTaskResponse] = Field(default_factory=list)
|