Files
InsightRadar/backend/app/schemas/event_schema.py
T
stardrophere 3d7d53f96f update
2026-03-12 13:00:10 +08:00

32 lines
778 B
Python

# app/schemas/event_schema.py
from pydantic import BaseModel, Field
from typing import List, Optional
from datetime import datetime
class PlatformTrendResponse(BaseModel):
source_id: int
platform_name: str
headline: str
url: Optional[str]
current_ranking: Optional[int]
ranking_history: List[int]
class UnifiedEventResponse(BaseModel):
event_id: int
unified_title: str
summary: Optional[str]
hot_score: int
created_at: datetime
last_active_at: datetime
platforms: List[PlatformTrendResponse]
tags: List[str] = Field(default_factory=list)
class PaginatedUnifiedEventResponse(BaseModel):
"""分页包装:避免一次性返回全量数据"""
total: int
has_more: bool
data: List[UnifiedEventResponse]