Skip to content

数据结构

实时热榜响应

ts
interface HotListResponse {
  code: number;
  name: string;
  title: string;
  type: string;
  description?: string;
  link?: string;
  total: number;
  data: HotListItem[];
  fromCache?: boolean;
  updateTime?: string;
  message?: string;
  params?: Record<string, unknown>;
}

interface HotListItem {
  id: string | number;
  title: string;
  desc?: string;
  cover?: string;
  author?: string;
  hot?: number | string;
  timestamp?: number;
  url: string;
  mobileUrl: string;
}

message 通常仅在上游抓取失败时出现。params 用于描述某个来源支持的 typerange 等动态选项。

历史热点分页

ts
interface HistoryResponse {
  data: HotItem[];
  total: number;
  page: number;
  limit: number;
  totalPages: number;
}

MongoDB 中的历史热点字段:

字段类型说明
sourcestring来源 ID
titlestring标题
descstring可选摘要
coverstring可选封面 URL
authorstring可选作者
hotnumber/string热度值
urlstring原始链接
mobileUrlstring移动端链接
timestampnumber内容时间戳,毫秒
createdAtDate入库时间
updatedAtDate更新时间

查询索引覆盖来源、URL、时间戳以及标题/描述全文搜索。

数据源配置

ts
interface SourceConfig {
  source: string;
  enabled: boolean;
  interval: number;
  lastFetchAt?: Date;
  createdAt?: Date;
  updatedAt?: Date;
}

interval 的单位为分钟,默认值为 30。

每日简报

ts
interface DailyBrief {
  briefDate: string;
  period: string;
  status: 'generating' | 'success' | 'failed';
  sources: string[];
  inputWindow: {
    start: Date;
    end: Date;
    lookbackHours: number;
  };
  analysis?: Record<string, unknown>;
  markdown?: string;
  rawInputItems: Record<string, unknown>[];
  searchEvidence: Record<string, unknown>[];
  model?: string;
  tavilyUsed: boolean;
  error?: string;
  createdAt?: Date;
  updatedAt?: Date;
}

briefDate + period 是唯一组合。默认前端响应会移除 rawInputItemssearchEvidence;仅在请求带有 includeDebug=true 时返回。

仅供技术研究与开发测试使用