优化情报分栏和日报展示

This commit is contained in:
Codex
2026-07-08 23:39:41 +08:00
parent 88e1cf4b7a
commit 8e15211f07
16 changed files with 371 additions and 93 deletions
+1
View File
@@ -44,6 +44,7 @@ class Signal(Base):
id: Mapped[int] = mapped_column(Integer, primary_key=True)
run_id: Mapped[int] = mapped_column(ForeignKey("agent_runs.id"), nullable=False, index=True)
source_type: Mapped[str] = mapped_column(String(20), nullable=False, default="news", index=True)
topic: Mapped[str] = mapped_column(String(120), nullable=False, index=True)
title: Mapped[str] = mapped_column(String(300), nullable=False)
summary: Mapped[str] = mapped_column(Text, nullable=False)
+2
View File
@@ -57,6 +57,7 @@ class AgentRepository:
if existing and existing.run_id != run.id:
return None
if existing:
existing.source_type = item.source_type
existing.topic = item.topic
existing.title = item.title
existing.summary = item.summary
@@ -68,6 +69,7 @@ class AgentRepository:
return existing
signal = Signal(
run_id=run.id,
source_type=item.source_type,
topic=item.topic,
title=item.title,
summary=item.summary,