优化情报分栏和日报展示
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user