mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 01:57:51 +08:00
24 lines
915 B
Python
24 lines
915 B
Python
# app/schemas/event_schema.py
|
|
from pydantic import BaseModel
|
|
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] # 排名历史轨迹,如 [50, 45, 20, 5, 1],供 ApexCharts 渲染
|
|
|
|
|
|
class UnifiedEventResponse(BaseModel):
|
|
event_id: int
|
|
unified_title: str # AI 生成的统一大标题
|
|
summary: Optional[str] # AI 生成的摘要
|
|
hot_score: int # 总热度值
|
|
created_at: datetime # 事件发现时间
|
|
platforms: List[PlatformTrendResponse] # 挂载的各个平台子热搜
|
|
# tags: List[str] = [] # 如果后续打通了 ExtractedTopic,可以在这里返回标签
|