feat: 修正章节排序和分类逻辑
- 新增 SQL 脚本以修正章节排序索引,确保与 8 个分类体系对齐。 - 更新 API 章节获取逻辑,始终返回所有 8 个预定义类别,未填充内容的类别使用占位符。 - 引入章节分类功能,支持从 5-stage 关键词映射到 8 个章节类别,提升内容分类准确性。 - 更新 Android 客户端以适应新的章节定义和占位逻辑,确保用户界面一致性。
This commit is contained in:
19
api/migrations/fix_chapter_order_index_v2.sql
Normal file
19
api/migrations/fix_chapter_order_index_v2.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- 修正章节排序索引,与 8 分类体系对齐
|
||||
-- childhood=0, education=1, career_early=2, career_achievement=3,
|
||||
-- career_challenge=4, family=5, beliefs=6, summary=7
|
||||
UPDATE chapters SET order_index = 0 WHERE category = 'childhood' AND order_index != 0;
|
||||
UPDATE chapters SET order_index = 1 WHERE category = 'education' AND order_index != 1;
|
||||
UPDATE chapters SET order_index = 2 WHERE category = 'career_early' AND order_index != 2;
|
||||
UPDATE chapters SET order_index = 3 WHERE category = 'career_achievement' AND order_index != 3;
|
||||
UPDATE chapters SET order_index = 4 WHERE category = 'career_challenge' AND order_index != 4;
|
||||
UPDATE chapters SET order_index = 5 WHERE category = 'family' AND order_index != 5;
|
||||
UPDATE chapters SET order_index = 6 WHERE category IN ('belief', 'beliefs') AND order_index != 6;
|
||||
UPDATE chapters SET order_index = 7 WHERE category = 'summary' AND order_index != 7;
|
||||
|
||||
-- 旧的 5-stage "career" 章节归入 career_early
|
||||
UPDATE chapters SET category = 'career_early', order_index = 2
|
||||
WHERE category = 'career';
|
||||
|
||||
-- 旧的 "belief" 统一为 "beliefs"
|
||||
UPDATE chapters SET category = 'beliefs'
|
||||
WHERE category = 'belief';
|
||||
Reference in New Issue
Block a user