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
47 lines
1001 B
Python
47 lines
1001 B
Python
"""查重 API Pydantic schemas。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class DuplicateSegmentResponse(BaseModel):
|
|
"""重复片段响应。"""
|
|
|
|
id: str
|
|
source_start: float
|
|
source_end: float
|
|
matched_video_id: str
|
|
matched_video_name: str
|
|
matched_start: float
|
|
matched_end: float
|
|
similarity: float
|
|
|
|
|
|
class DuplicationRecordResponse(BaseModel):
|
|
"""查重记录响应(列表项)。"""
|
|
|
|
id: str
|
|
filename: str
|
|
file_size: int
|
|
duration_seconds: float = 0.0
|
|
status: str = "pending"
|
|
duplicate_rate: float | None = None
|
|
duplicate_count: int = 0
|
|
created_at: str
|
|
updated_at: str
|
|
|
|
|
|
class DuplicationDetailResponse(DuplicationRecordResponse):
|
|
"""查重详情响应(含重复片段)。"""
|
|
|
|
segments: list[DuplicateSegmentResponse] = Field(default_factory=list)
|
|
|
|
|
|
class DuplicationUploadResponse(BaseModel):
|
|
"""上传查重响应。"""
|
|
|
|
id: str
|
|
status: str
|
|
message: str
|