7564b50f7e
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 1m46s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 1m51s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 15m40s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 1m50s
CI/CD Pipeline / Build Staging API Image (push) Successful in 18m32s
CI/CD Pipeline / Integration Tests (push) Successful in 3m4s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m25s
CI/CD Pipeline / Validate - Style (push) Successful in 3m35s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 44s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m38s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m53s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 3m4s
CI/CD Pipeline / Validate - Security (push) Successful in 8m10s
CI/CD Pipeline / Unit Tests (push) Successful in 9m9s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Failing after 9h23m26s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 9h48m20s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 9h22m39s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 9h47m32s
CI/CD Pipeline / PR Build Web Image (push) Failing after 9h47m31s
CI/CD Pipeline / PR Build API Image (push) Failing after 9h47m32s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 9h28m53s
CI/CD Pipeline / CI Gate (push) Failing after 9h22m39s
CI/CD Pipeline / Canary Release to Production (push) Failing after 9h22m37s
CI/CD Pipeline / Build Production Web Image (push) Failing after 9h22m39s
CI/CD Pipeline / Build Production API Image (push) Failing after 9h22m39s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 9h28m53s
CI/CD Pipeline / Frontend Lint (push) Failing after 9h31m49s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 10h4m41s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
55 lines
1.4 KiB
Python
55 lines
1.4 KiB
Python
"""Script (口播文案库) Pydantic schemas — Issue #1795."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
from typing import Any, Dict, 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)
|
|
title_text: str = ""
|
|
title_category: str = ""
|
|
title_config: Dict[str, Any] = Field(default_factory=dict)
|
|
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)
|
|
title_text: str = ""
|
|
title_category: str = ""
|
|
title_config: Optional[Dict[str, Any]] = None
|
|
|
|
|
|
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
|
|
title_text: Optional[str] = None
|
|
title_category: Optional[str] = None
|
|
title_config: Optional[Dict[str, Any]] = None
|