4244c558a5
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 47s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 47s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m13s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m26s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m48s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m5s
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 26h39m38s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 26h39m44s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 26h39m53s
CI/CD Pipeline / PR Build Web Image (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 26h39m6s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 26h39m6s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 26h39m8s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 26h39m15s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 26h39m13s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 26h39m13s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 26h39m0s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 26h39m3s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 26h39m16s
- UP007: Optional[X] -> X | None - UP006: List/Dict/Tuple/Set/Type -> list/dict/tuple/set/type - UP017: timezone.utc -> datetime.UTC - UP035: 移除 typing 模块已弃用的导入 共修复 224 个文件,971 处问题 B006/B909/B904/B023 在 develop 上已全部通过 B008 已在 ruff 配置中忽略(FastAPI Depends 模式) Closes #1834
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
"""Script (口播文案库) Pydantic schemas — Issue #1795."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ScriptSegment(BaseModel):
|
|
"""单段文案."""
|
|
|
|
text: str
|
|
duration: Optional[float] = None
|
|
|
|
|
|
class ScriptResponse(BaseModel):
|
|
id: str
|
|
user_id: str
|
|
title: str
|
|
content: str
|
|
segments: list[ScriptSegment] = Field(default_factory=list)
|
|
tags: list[str] = Field(default_factory=list)
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
|
|
class ScriptListResponse(BaseModel):
|
|
items: list[ScriptResponse]
|
|
total: int = 0
|
|
|
|
|
|
class CreateScriptRequest(BaseModel):
|
|
title: str = Field(..., min_length=1, max_length=255)
|
|
content: str = ""
|
|
segments: list[ScriptSegment] = Field(default_factory=list)
|
|
tags: list[str] = Field(default_factory=list)
|
|
|
|
|
|
class UpdateScriptRequest(BaseModel):
|
|
title: Optional[str] = Field(None, min_length=1, max_length=255)
|
|
content: Optional[str] = None
|
|
segments: Optional[list[ScriptSegment]] = None
|
|
tags: Optional[list[str]] = None
|