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

@@ -0,0 +1,8 @@
-- 为 chapters 表添加 is_active 字段
-- 用于支持"清除回忆"功能:将章节标记为 disabled 而非物理删除
-- 默认值为 TRUE现有章节全部为 active
ALTER TABLE chapters ADD COLUMN IF NOT EXISTS is_active BOOLEAN DEFAULT TRUE;
-- 确保现有数据全部为 active
UPDATE chapters SET is_active = TRUE WHERE is_active IS NULL;