feat: 添加章节管理功能以支持清除回忆

- 在数据库模型中新增 is_active 字段,用于标记章节是否启用。
- 添加数据库迁移脚本以更新现有章节,确保默认值为 TRUE。
- 更新章节相关的 API 以仅返回 active 章节,并实现清除章节的功能。
- 在 Android 客户端中实现清除章节的确认弹窗和相应的 API 调用,提升用户体验。
This commit is contained in:
penghanyuan
2026-02-14 10:57:51 +01:00
parent df91719a2f
commit 39736a2ae2
8 changed files with 180 additions and 20 deletions

View File

@@ -89,6 +89,7 @@ class Chapter(Base):
updated_at = Column(DateTime(timezone=True), default=utc_now, onupdate=utc_now)
category = Column(String, nullable=True) # 章节分类
is_new = Column(Boolean, default=True) # 是否为新内容(未读)
is_active = Column(Boolean, default=True) # 是否启用(清除回忆后置为 False
source_segments = Column(JSON, nullable=True) # 来源 segment IDs 列表
# Relationships