Преглед изворни кода

🚚 (api-v13): tipitaka-chapters 改名 tipitaka-titles

它列的是章节标题(按名字找章节,或列出一本书的标题目录),不是章节正文;
tipitaka-chapters 容易被误会成取章节内容,改名。旧路径删除,不留转发。

- 类名随之改为 TipitakaTitle*(控制器、Resource、FormRequest、Service、测试),缓存键改新路径
- 规格与 dashboard-v6 / wikipali-mobile 的 schema.d.ts 重新生成;v2 search-title-index 的弃用说明指向新路径
- v6:searchChapters → searchTitles、ChapterHit → TitleHit、useChapterSearch → useTitleSearch,
  四个标签页共用的层级类型 ChapterLayer → TipitakaLayer
- api-test 用例与客户端、dashboard-test、CLAUDE.md 对照表、documents/search-recall.md 同步

注意:文件改名(git mv)在 208721622 里已被一并提交,但内容没跟上——208721622..0415a9846
这三个提交里文件名与类名不一致,后端会自动加载失败;本提交补齐。
wikipali-plugins 已改调新路径(未提交),需与本提交同时上线,否则旧插件的 locate / toc 会 404。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
visuddhinanda пре 10 часа
родитељ
комит
c29e5d5c27
30 измењених фајлова са 289 додато и 284 уклоњено
  1. 1 1
      CLAUDE.md
  2. 15 15
      api-test/cases/11_tipitaka_titles.php
  3. 15 15
      api-test/client/.openapi-generator/FILES
  4. 30 30
      api-test/client/lib/Api/TipitakaTitlesApi.php
  5. 7 7
      api-test/client/lib/Model/GetApiV3TipitakaTitles200Response.php
  6. 10 10
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInner.php
  7. 4 4
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInner.php
  8. 4 4
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner.php
  9. 3 3
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.php
  10. 10 7
      api-v13/app/Http/Controllers/V3/TipitakaTitleController.php
  11. 2 2
      api-v13/app/Http/Requests/V3/IndexTipitakaTitleRequest.php
  12. 3 3
      api-v13/app/Http/Resources/V3/TipitakaTitleResource.php
  13. 1 1
      api-v13/app/Services/V3/TipitakaBookService.php
  14. 2 2
      api-v13/app/Services/V3/TipitakaTitleService.php
  15. 3 3
      api-v13/documents/search-recall.md
  16. 5 3
      api-v13/routes/v3/tipitaka.php
  17. 19 19
      api-v13/tests/Feature/TipitakaTitleV3Test.php
  18. 3 3
      dashboard-test/src/tests/search.spec.ts
  19. 105 105
      dashboard-v6/src/api/schema.d.ts
  20. 10 10
      dashboard-v6/src/api/tipitaka-search.ts
  21. 3 3
      dashboard-v6/src/features/search/LayerTag.tsx
  22. 5 5
      dashboard-v6/src/features/search/SearchPanel.tsx
  23. 7 7
      dashboard-v6/src/features/search/TitleTab.tsx
  24. 3 3
      dashboard-v6/src/features/search/categories.ts
  25. 7 7
      dashboard-v6/src/features/search/hooks.ts
  26. 4 4
      dashboard-v6/src/features/search/state.ts
  27. 2 2
      openapi/public/assets/protocol/main.yaml
  28. 1 1
      openapi/public/assets/protocol/overrides/v2-search-title-index.yaml
  29. 1 1
      openapi/public/assets/protocol/resources/auto/v2-search-title-index.yaml
  30. 4 4
      openapi/public/assets/protocol/resources/auto/v3-tipitaka-titles.yaml

+ 1 - 1
CLAUDE.md

@@ -354,7 +354,7 @@ Resource / FormRequest / 测试同理;URL 只换版本前缀
 | `access-token`(agent 用途)/ `AccessTokenController@store` | `agent-grants` / `V3\AgentGrantController` | 人类为自己名下的 AI 模型签 channel 写入授权。载荷由服务端决定(v2 原样签客户端 payload)、绑定模型(act)与签发人(grantor)、带模型 token_version、独立密钥;写入时放 `X-Agent-Grant` 头而不是请求体 |
 | `sent-discussion-tree`(部分)/ `DiscussionController@discussion_tree` | `tipitaka-discussions/{channel}` / `V3\TipitakaDiscussionController` | 新能力为主:按经文范围(channel 必填;`book` + `chapter` 或 `para`/`to`,不给 book 即整个 channel)列挂在句子上的话题,每条带 `sentence` 坐标,按经文顺序排;`type` 可逗号多选,默认只列话题,可见性同 `/v3/discussions`。v2 那条要调用方逐句列出坐标、只回标题与回复数,未迁也不迁(只有 v4 在用)。与 `/v3/discussions`(单个对象)必填参数不同,按规范第 1 条分成两个端点 |
 | `sign-in` + `auth/current` / `AuthController@signIn` + `@getUserInfoByToken` | `sessions` + `me` / `V3\SessionController` + `V3\MeController` | 登录一次返回 `{token, user}`,不再二次查询;`login` 字段收用户名或邮箱(邮箱不区分大小写),失败统一 422 `errors.login`;按账号 + IP 限流。`me` 的字段沿用 v2 的驼峰用户摘要(`UserService::profile()`),`roles` 恒为数组,另加 `email`,不再回显 token。token 与 v2 完全相同、两边互认 |
-| `search-title-index` / `SearchTitleController@index` | `tipitaka-chapters` / `V3\TipitakaChapterController` | 章节标题检索。v2 只回标题文字、`LIKE` 硬匹配、依赖去变音不干净的 `title_en`;v3 回坐标(book/para)、层级、`layer`(mula/atthakatha/tika/anna,取自书的 tag)、段数与字符数、上下章、路径、公开 channel 的章节译名;匹配不分大小写与变音符号、去序号与丛书缩写、拼错按编辑距离容错(档位:相等 1 / 开头 0.95 / 包含 0.9 / 拼错 ≤0.85)。不给 `q` 给 `book`(可加 `para`、`max_level`)= 按经文顺序列出整本书的标题,给 agent「先选书再选章」用。标题目录缓存一天(`TipitakaChapterService`)。**`q` 的 PHP 匹配只用来验证按名定位的效果,正式实现走 OpenSearch**(插件 `locate` 将改调 `/v3/search`,见 `api-v13/documents/search-recall.md` 4.6),这里不再扩展 |
+| `search-title-index` / `SearchTitleController@index` | `tipitaka-titles` / `V3\TipitakaTitleController`(逻辑在 `V3\TipitakaTitleService`) | 章节标题检索。**2026-11-19 前叫 `tipitaka-chapters` / `TipitakaChapterController`**,容易误会成章节正文,改名(旧路径删除,v6、api-test、插件同步切换)。v2 只回标题文字、`LIKE` 硬匹配、依赖去变音不干净的 `title_en`;v3 回坐标(book/para)、层级、`layer`(mula/atthakatha/tika/anna,取自书的 tag)、段数与字符数、上下章、路径、公开 channel 的章节译名;匹配不分大小写与变音符号、去序号与丛书缩写、拼错按编辑距离容错(档位:相等 1 / 开头 0.95 / 包含 0.9 / 拼错 ≤0.85)。不给 `q` 给 `book`(可加 `para`、`max_level`)= 按经文顺序列出整本书的标题,给 agent「先选书再选章」用。标题目录缓存一天(`TipitakaTitleService`)。**`q` 的 PHP 匹配只用来验证按名定位的效果,正式实现走 OpenSearch**(插件 `locate` 将改调 `/v3/search`,见 `api-v13/documents/search-recall.md` 4.6),这里不再扩展 |
 | `progress?view=chapter_channels` / `ProgressChapterController@index`(一个 view 分支) | `tipitaka-chapter-channels/{book}/{para}` / `V3\TipitakaChapterChannelController` | 某章有哪些 channel 及完成度(阅读页版本切换)。`par`→路径 `{para}`;**只列看得见的 channel**(公开 + 自己的 + 共享给自己或所在群组的;v2 连私有 channel 也对所有人列);字段重组:行 `uid`→`id`,`channel_id`/`name`/`type` 收进 `channel{id,name,type,lang}`;去掉 `likes`(前端没用);views/studio 整页批量查,消除 N+1;按 progress 降序 + channel_id 稳定排序,分页(per_page 最大 200)。v6、mobile、wikipali-plugins(`versions --chapter`)已切 |
 | `group-member`(`view=user`、`view=group`、新建、删除)/ `GroupMemberController` | `me/groups` + `groups/{group}/members`(+`/{member}`)/ `V3\MeGroupController` + `V3\GroupMemberController` | 团队成员(界面叫「团队」,团队空间以团队为 owner)。新增角色列 `group_members.role`(owner / manager / editor / reader,为空按 v2 的 `power` 推导,v4 下线后回填并改 NOT NULL);改角色是新增的 PATCH(role 与 power 同写),加人可指定角色、默认 reader;本人可退出(v2 普通成员退不了);owner 那行不可改、不可移;不支持 agent 代写。`me/groups` 每条带我的 `role` 与 `member_id`。权限表在 `App\Services\V3\GroupAbilityService`,后续资源的团队空间权限都走它。团队本身(`/v2/group`)未迁 |
 | `group`(`view=all`、`view=studio`+`view2`、单条、新建、修改、删除)+ `group-my-number` + `share?view=group` / `GroupController` + `ShareController@index` | `groups`(+`/{group}`)+ `me/groups?owned=&search=` + `groups/{group}/shares`(+`/{share}`)/ `V3\GroupController` + `V3\MeGroupController` + `V3\GroupShareController` | 团队本身与团队文档。`view=all`→`GET groups?search=`,**只搜公开团队**(v2 不登录就能列出私有团队);「我创建的 / 我参加的」→`me/groups?owned=true\|false`,`group-my-number` 去掉、数量读 `meta.total`;新建不收 `studio_name`(由登录态决定)、同一人名下不重名;改信息 owner 与 manager 都能改(v2 只有 owner),只有 PATCH,不再覆盖 `create_time`;删除只有 owner,**名下还有资源(channel、文章等 16 类 owner 列)时 409** 并给出各类条数,否则连同成员与共享给团队的 share 一起硬删(v2 照删、资源变孤儿);详情带查看者的 `role`,私有团队非成员 403。团队文档每项带资源类型 / 标题 / 拥有者摘要与团队对它的权限(reader / editor),团队 owner / manager 或资源拥有者可移出团队。资源本身的协作者管理(`share?view=res`、给人加共享)仍走 v2。不支持 agent 代写 |

+ 15 - 15
api-test/cases/11_tipitaka_titles.php

@@ -1,44 +1,44 @@
 <?php
 
-use \WikipaliApi\Api\TipitakaChaptersApi;
+use \WikipaliApi\Api\TipitakaTitlesApi;
 
 /*
- * 章节标题:GET /v3/tipitaka-chapters
+ * 章节标题:GET /v3/tipitaka-titles
  *
  * 只读、无写操作。用长部《大般涅槃经》(book 94 para 287)——CST 三藏的坐标在各服务器上相同。
- * 容错打分的各档、译名可见性、layer 过滤由 api-v13 的 TipitakaChapterV3Test 覆盖。
+ * 容错打分的各档、译名可见性、layer 过滤由 api-v13 的 TipitakaTitleV3Test 覆盖。
  */
 
-test('GET /v3/tipitaka-chapters?q=(不带变音符号、拼错)→ 200,找到大般涅槃经', function () {
-    $res = request(fn () => api(TipitakaChaptersApi::class)
-        ->getApiV3TipitakaChaptersWithHttpInfo(1, 5, 'mahaparinibanasuta', null, null, 'mula'));
-    assert_status(200, $res, 'tipitaka-chapters q');
+test('GET /v3/tipitaka-titles?q=(不带变音符号、拼错)→ 200,找到大般涅槃经', function () {
+    $res = request(fn () => api(TipitakaTitlesApi::class)
+        ->getApiV3TipitakaTitlesWithHttpInfo(1, 5, 'mahaparinibanasuta', null, null, 'mula'));
+    assert_status(200, $res, 'tipitaka-titles q');
     $top = $res['body']['data'][0] ?? null;
     if (! $top) {
-        fail('tipitaka-chapters:拼错的经名应能找到');
+        fail('tipitaka-titles:拼错的经名应能找到');
     }
     assert_eq(94, $top['book'] ?? null, 'book');
     assert_eq(287, $top['para'] ?? null, 'para');
     assert_eq('mula', $top['layer'] ?? null, 'layer');
     foreach (['title', 'translations', 'paragraphs', 'chars', 'path', 'score'] as $key) {
-        assert_has_key($key, $top, 'tipitaka-chapters 行');
+        assert_has_key($key, $top, 'tipitaka-titles 行');
     }
 });
 
-test('GET /v3/tipitaka-chapters?book=&para= → 200,按经文顺序列出这一章下面的标题', function () {
-    $res = raw('GET', '/v3/tipitaka-chapters', ['book' => 94, 'para' => 287, 'per_page' => 1000]);
-    assert_status(200, $res, 'tipitaka-chapters book');
+test('GET /v3/tipitaka-titles?book=&para= → 200,按经文顺序列出这一章下面的标题', function () {
+    $res = raw('GET', '/v3/tipitaka-titles', ['book' => 94, 'para' => 287, 'per_page' => 1000]);
+    assert_status(200, $res, 'tipitaka-titles book');
     $paras = array_column($res['body']['data'] ?? [], 'para');
     assert_eq(287, $paras[0] ?? null, '第一条是这一章自己');
     $sorted = $paras;
     sort($sorted);
     assert_eq($sorted, $paras, '按段号升序');
     if (! in_array(585, $paras, true)) {
-        fail('tipitaka-chapters:应包含小节 94:585(Tathāgatapacchimavācā)');
+        fail('tipitaka-titles:应包含小节 94:585(Tathāgatapacchimavācā)');
     }
 });
 
-test('GET /v3/tipitaka-chapters(q 与 book 都不给)→ 422', function () {
-    $res = raw('GET', '/v3/tipitaka-chapters');
+test('GET /v3/tipitaka-titles(q 与 book 都不给)→ 422', function () {
+    $res = raw('GET', '/v3/tipitaka-titles');
     assert_status(422, $res, '无条件');
 });

+ 15 - 15
api-test/client/.openapi-generator/FILES

@@ -35,12 +35,12 @@ docs/Api/StudiosApi.md
 docs/Api/TermsApi.md
 docs/Api/TipitakaChannelsApi.md
 docs/Api/TipitakaChapterChannelsApi.md
-docs/Api/TipitakaChaptersApi.md
 docs/Api/TipitakaDiscussionsApi.md
 docs/Api/TipitakaPageNumbersApi.md
 docs/Api/TipitakaParagraphChannelsApi.md
 docs/Api/TipitakaReadingApi.md
 docs/Api/TipitakaRelatedParagraphsApi.md
+docs/Api/TipitakaTitlesApi.md
 docs/Api/TipitakaWordParagraphsApi.md
 docs/Api/UpgradeApi.md
 docs/Api/UsersApi.md
@@ -155,10 +155,6 @@ docs/Model/GetApiV3TipitakaChapterChannelsBookPara200Response.md
 docs/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerChannel.md
 docs/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerStudio.md
-docs/Model/GetApiV3TipitakaChapters200Response.md
-docs/Model/GetApiV3TipitakaChapters200ResponseDataInner.md
-docs/Model/GetApiV3TipitakaChapters200ResponseDataInnerPathInner.md
-docs/Model/GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner.md
 docs/Model/GetApiV3TipitakaPageNumbersPage200Response.md
 docs/Model/GetApiV3TipitakaPageNumbersPage200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaPageNumbersPage200ResponseMeta.md
@@ -173,6 +169,10 @@ docs/Model/GetApiV3TipitakaRelatedParagraphsAggregate200Response.md
 docs/Model/GetApiV3TipitakaRelatedParagraphsAggregate200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200Response.md
 docs/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInner.md
+docs/Model/GetApiV3TipitakaTitles200Response.md
+docs/Model/GetApiV3TipitakaTitles200ResponseDataInner.md
+docs/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInner.md
+docs/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner.md
 docs/Model/GetApiV3TipitakaWordParagraphs200Response.md
 docs/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner.md
@@ -281,12 +281,12 @@ lib/Api/StudiosApi.php
 lib/Api/TermsApi.php
 lib/Api/TipitakaChannelsApi.php
 lib/Api/TipitakaChapterChannelsApi.php
-lib/Api/TipitakaChaptersApi.php
 lib/Api/TipitakaDiscussionsApi.php
 lib/Api/TipitakaPageNumbersApi.php
 lib/Api/TipitakaParagraphChannelsApi.php
 lib/Api/TipitakaReadingApi.php
 lib/Api/TipitakaRelatedParagraphsApi.php
+lib/Api/TipitakaTitlesApi.php
 lib/Api/TipitakaWordParagraphsApi.php
 lib/Api/UpgradeApi.php
 lib/Api/UsersApi.php
@@ -405,10 +405,6 @@ lib/Model/GetApiV3TipitakaChapterChannelsBookPara200Response.php
 lib/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerChannel.php
 lib/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerStudio.php
-lib/Model/GetApiV3TipitakaChapters200Response.php
-lib/Model/GetApiV3TipitakaChapters200ResponseDataInner.php
-lib/Model/GetApiV3TipitakaChapters200ResponseDataInnerPathInner.php
-lib/Model/GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner.php
 lib/Model/GetApiV3TipitakaPageNumbersPage200Response.php
 lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseMeta.php
@@ -423,6 +419,10 @@ lib/Model/GetApiV3TipitakaRelatedParagraphsAggregate200Response.php
 lib/Model/GetApiV3TipitakaRelatedParagraphsAggregate200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200Response.php
 lib/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInner.php
+lib/Model/GetApiV3TipitakaTitles200Response.php
+lib/Model/GetApiV3TipitakaTitles200ResponseDataInner.php
+lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInner.php
+lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner.php
 lib/Model/GetApiV3TipitakaWordParagraphs200Response.php
 lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner.php
@@ -533,12 +533,12 @@ test/Api/StudiosApiTest.php
 test/Api/TermsApiTest.php
 test/Api/TipitakaChannelsApiTest.php
 test/Api/TipitakaChapterChannelsApiTest.php
-test/Api/TipitakaChaptersApiTest.php
 test/Api/TipitakaDiscussionsApiTest.php
 test/Api/TipitakaPageNumbersApiTest.php
 test/Api/TipitakaParagraphChannelsApiTest.php
 test/Api/TipitakaReadingApiTest.php
 test/Api/TipitakaRelatedParagraphsApiTest.php
+test/Api/TipitakaTitlesApiTest.php
 test/Api/TipitakaWordParagraphsApiTest.php
 test/Api/UpgradeApiTest.php
 test/Api/UsersApiTest.php
@@ -653,10 +653,6 @@ test/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerChannelTes
 test/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerStudioTest.php
 test/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseTest.php
-test/Model/GetApiV3TipitakaChapters200ResponseDataInnerPathInnerTest.php
-test/Model/GetApiV3TipitakaChapters200ResponseDataInnerTest.php
-test/Model/GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInnerTest.php
-test/Model/GetApiV3TipitakaChapters200ResponseTest.php
 test/Model/GetApiV3TipitakaPageNumbersPage200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaPageNumbersPage200ResponseMetaTest.php
 test/Model/GetApiV3TipitakaPageNumbersPage200ResponseTest.php
@@ -671,6 +667,10 @@ test/Model/GetApiV3TipitakaRelatedParagraphsAggregate200ResponseDataInnerTest.ph
 test/Model/GetApiV3TipitakaRelatedParagraphsAggregate200ResponseTest.php
 test/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaRelatedParagraphsAggregateBookName200ResponseTest.php
+test/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInnerTest.php
+test/Model/GetApiV3TipitakaTitles200ResponseDataInnerTest.php
+test/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInnerTest.php
+test/Model/GetApiV3TipitakaTitles200ResponseTest.php
 test/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInnerTest.php
 test/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaWordParagraphs200ResponseTest.php

+ 30 - 30
api-test/client/lib/Api/TipitakaChaptersApi.php → api-test/client/lib/Api/TipitakaTitlesApi.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * TipitakaChaptersApi
+ * TipitakaTitlesApi
  * PHP version 8.1
  *
  * @category Class
@@ -43,14 +43,14 @@ use WikipaliApi\HeaderSelector;
 use WikipaliApi\ObjectSerializer;
 
 /**
- * TipitakaChaptersApi Class Doc Comment
+ * TipitakaTitlesApi Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
  * @author   OpenAPI Generator team
  * @link     https://openapi-generator.tech
  */
-class TipitakaChaptersApi
+class TipitakaTitlesApi
 {
     /**
      * @var ClientInterface
@@ -74,7 +74,7 @@ class TipitakaChaptersApi
 
     /** @var string[] $contentTypes **/
     public const contentTypes = [
-        'getApiV3TipitakaChapters' => [
+        'getApiV3TipitakaTitles' => [
             'application/json',
         ],
     ];
@@ -126,7 +126,7 @@ class TipitakaChaptersApi
     }
 
     /**
-     * Operation getApiV3TipitakaChapters
+     * Operation getApiV3TipitakaTitles
      *
      * 找章节
      *
@@ -137,20 +137,20 @@ class TipitakaChaptersApi
      * @param  int|null $para 只列 book 里这一章下面的标题(含它自己),要和 book 一起给 (optional)
      * @param  string|null $layer 只要某几层,逗号分隔 (optional)
      * @param  int|null $max_level 只要层级不深于它的标题(1 是书名) (optional)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaChapters'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaTitles'] to see the possible values for this operation
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return \WikipaliApi\Model\GetApiV3TipitakaChapters200Response|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200Response|\WikipaliApi\Model\ProblemDetails
      */
-    public function getApiV3TipitakaChapters($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaChapters'][0])
+    public function getApiV3TipitakaTitles($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaTitles'][0])
     {
-        list($response) = $this->getApiV3TipitakaChaptersWithHttpInfo($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
+        list($response) = $this->getApiV3TipitakaTitlesWithHttpInfo($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
         return $response;
     }
 
     /**
-     * Operation getApiV3TipitakaChaptersWithHttpInfo
+     * Operation getApiV3TipitakaTitlesWithHttpInfo
      *
      * 找章节
      *
@@ -161,15 +161,15 @@ class TipitakaChaptersApi
      * @param  int|null $para 只列 book 里这一章下面的标题(含它自己),要和 book 一起给 (optional)
      * @param  string|null $layer 只要某几层,逗号分隔 (optional)
      * @param  int|null $max_level 只要层级不深于它的标题(1 是书名) (optional)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaChapters'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaTitles'] to see the possible values for this operation
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return array of \WikipaliApi\Model\GetApiV3TipitakaChapters200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\GetApiV3TipitakaTitles200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function getApiV3TipitakaChaptersWithHttpInfo($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaChapters'][0])
+    public function getApiV3TipitakaTitlesWithHttpInfo($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaTitles'][0])
     {
-        $request = $this->getApiV3TipitakaChaptersRequest($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
+        $request = $this->getApiV3TipitakaTitlesRequest($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -197,7 +197,7 @@ class TipitakaChaptersApi
             switch($statusCode) {
                 case 200:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\GetApiV3TipitakaChapters200Response',
+                        '\WikipaliApi\Model\GetApiV3TipitakaTitles200Response',
                         $request,
                         $response,
                     );
@@ -225,7 +225,7 @@ class TipitakaChaptersApi
             }
 
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\GetApiV3TipitakaChapters200Response',
+                '\WikipaliApi\Model\GetApiV3TipitakaTitles200Response',
                 $request,
                 $response,
             );
@@ -234,7 +234,7 @@ class TipitakaChaptersApi
                 case 200:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\GetApiV3TipitakaChapters200Response',
+                        '\WikipaliApi\Model\GetApiV3TipitakaTitles200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -255,7 +255,7 @@ class TipitakaChaptersApi
     }
 
     /**
-     * Operation getApiV3TipitakaChaptersAsync
+     * Operation getApiV3TipitakaTitlesAsync
      *
      * 找章节
      *
@@ -266,14 +266,14 @@ class TipitakaChaptersApi
      * @param  int|null $para 只列 book 里这一章下面的标题(含它自己),要和 book 一起给 (optional)
      * @param  string|null $layer 只要某几层,逗号分隔 (optional)
      * @param  int|null $max_level 只要层级不深于它的标题(1 是书名) (optional)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaChapters'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaTitles'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3TipitakaChaptersAsync($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaChapters'][0])
+    public function getApiV3TipitakaTitlesAsync($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaTitles'][0])
     {
-        return $this->getApiV3TipitakaChaptersAsyncWithHttpInfo($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType)
+        return $this->getApiV3TipitakaTitlesAsyncWithHttpInfo($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -282,7 +282,7 @@ class TipitakaChaptersApi
     }
 
     /**
-     * Operation getApiV3TipitakaChaptersAsyncWithHttpInfo
+     * Operation getApiV3TipitakaTitlesAsyncWithHttpInfo
      *
      * 找章节
      *
@@ -293,15 +293,15 @@ class TipitakaChaptersApi
      * @param  int|null $para 只列 book 里这一章下面的标题(含它自己),要和 book 一起给 (optional)
      * @param  string|null $layer 只要某几层,逗号分隔 (optional)
      * @param  int|null $max_level 只要层级不深于它的标题(1 是书名) (optional)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaChapters'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaTitles'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3TipitakaChaptersAsyncWithHttpInfo($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaChapters'][0])
+    public function getApiV3TipitakaTitlesAsyncWithHttpInfo($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaTitles'][0])
     {
-        $returnType = '\WikipaliApi\Model\GetApiV3TipitakaChapters200Response';
-        $request = $this->getApiV3TipitakaChaptersRequest($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
+        $returnType = '\WikipaliApi\Model\GetApiV3TipitakaTitles200Response';
+        $request = $this->getApiV3TipitakaTitlesRequest($page, $per_page, $q, $book, $para, $layer, $max_level, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -340,7 +340,7 @@ class TipitakaChaptersApi
     }
 
     /**
-     * Create request for operation 'getApiV3TipitakaChapters'
+     * Create request for operation 'getApiV3TipitakaTitles'
      *
      * @param  int|null $page 页码 (optional, default to 1)
      * @param  int|null $per_page 每页数量,最大 1000 (optional, default to 50)
@@ -349,12 +349,12 @@ class TipitakaChaptersApi
      * @param  int|null $para 只列 book 里这一章下面的标题(含它自己),要和 book 一起给 (optional)
      * @param  string|null $layer 只要某几层,逗号分隔 (optional)
      * @param  int|null $max_level 只要层级不深于它的标题(1 是书名) (optional)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaChapters'] to see the possible values for this operation
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaTitles'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function getApiV3TipitakaChaptersRequest($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaChapters'][0])
+    public function getApiV3TipitakaTitlesRequest($page = 1, $per_page = 50, $q = null, $book = null, $para = null, $layer = null, $max_level = null, string $contentType = self::contentTypes['getApiV3TipitakaTitles'][0])
     {
 
 
@@ -365,7 +365,7 @@ class TipitakaChaptersApi
 
 
 
-        $resourcePath = '/v3/tipitaka-chapters';
+        $resourcePath = '/v3/tipitaka-titles';
         $formParams = [];
         $queryParams = [];
         $headerParams = [];

+ 7 - 7
api-test/client/lib/Model/GetApiV3TipitakaChapters200Response.php → api-test/client/lib/Model/GetApiV3TipitakaTitles200Response.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * GetApiV3TipitakaChapters200Response
+ * GetApiV3TipitakaTitles200Response
  *
  * PHP version 8.1
  *
@@ -32,7 +32,7 @@ use \ArrayAccess;
 use \WikipaliApi\ObjectSerializer;
 
 /**
- * GetApiV3TipitakaChapters200Response Class Doc Comment
+ * GetApiV3TipitakaTitles200Response Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
@@ -40,7 +40,7 @@ use \WikipaliApi\ObjectSerializer;
  * @link     https://openapi-generator.tech
  * @implements \ArrayAccess<string, mixed>
  */
-class GetApiV3TipitakaChapters200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+class GetApiV3TipitakaTitles200Response implements ModelInterface, ArrayAccess, \JsonSerializable
 {
     public const DISCRIMINATOR = null;
 
@@ -49,7 +49,7 @@ class GetApiV3TipitakaChapters200Response implements ModelInterface, ArrayAccess
      *
      * @var string
      */
-    protected static $openAPIModelName = 'get_api_v3_tipitaka_chapters_200_response';
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_titles_200_response';
 
     /**
      * Array of property to type mappings. Used for (de)serialization
@@ -57,7 +57,7 @@ class GetApiV3TipitakaChapters200Response implements ModelInterface, ArrayAccess
      * @var string[]
      */
     protected static $openAPITypes = [
-        'data' => '\WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInner[]',
+        'data' => '\WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInner[]',
         'meta' => '\WikipaliApi\Model\PaginationMeta'
     ];
 
@@ -299,7 +299,7 @@ class GetApiV3TipitakaChapters200Response implements ModelInterface, ArrayAccess
     /**
      * Gets data
      *
-     * @return \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInner[]|null
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInner[]|null
      */
     public function getData()
     {
@@ -309,7 +309,7 @@ class GetApiV3TipitakaChapters200Response implements ModelInterface, ArrayAccess
     /**
      * Sets data
      *
-     * @param \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInner[]|null $data data
+     * @param \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInner[]|null $data data
      *
      * @return self
      */

+ 10 - 10
api-test/client/lib/Model/GetApiV3TipitakaChapters200ResponseDataInner.php → api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInner.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * GetApiV3TipitakaChapters200ResponseDataInner
+ * GetApiV3TipitakaTitles200ResponseDataInner
  *
  * PHP version 8.1
  *
@@ -32,7 +32,7 @@ use \ArrayAccess;
 use \WikipaliApi\ObjectSerializer;
 
 /**
- * GetApiV3TipitakaChapters200ResponseDataInner Class Doc Comment
+ * GetApiV3TipitakaTitles200ResponseDataInner Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
@@ -40,7 +40,7 @@ use \WikipaliApi\ObjectSerializer;
  * @link     https://openapi-generator.tech
  * @implements \ArrayAccess<string, mixed>
  */
-class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+class GetApiV3TipitakaTitles200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
 {
     public const DISCRIMINATOR = null;
 
@@ -49,7 +49,7 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
      *
      * @var string
      */
-    protected static $openAPIModelName = 'get_api_v3_tipitaka_chapters_200_response_data_inner';
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_titles_200_response_data_inner';
 
     /**
      * Array of property to type mappings. Used for (de)serialization
@@ -61,14 +61,14 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
         'para' => 'int',
         'level' => 'int',
         'title' => 'string',
-        'translations' => '\WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner[]',
+        'translations' => '\WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner[]',
         'layer' => 'string',
         'paragraphs' => 'int',
         'chars' => 'int',
         'parent' => 'int',
         'prev' => 'int',
         'next' => 'int',
-        'path' => '\WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]',
+        'path' => '\WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]',
         'score' => 'float'
     ];
 
@@ -484,7 +484,7 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
     /**
      * Gets translations
      *
-     * @return \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner[]|null
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner[]|null
      */
     public function getTranslations()
     {
@@ -494,7 +494,7 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
     /**
      * Sets translations
      *
-     * @param \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner[]|null $translations translations
+     * @param \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner[]|null $translations translations
      *
      * @return self
      */
@@ -694,7 +694,7 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
     /**
      * Gets path
      *
-     * @return \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]|null
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null
      */
     public function getPath()
     {
@@ -704,7 +704,7 @@ class GetApiV3TipitakaChapters200ResponseDataInner implements ModelInterface, Ar
     /**
      * Sets path
      *
-     * @param \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]|null $path path
+     * @param \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null $path path
      *
      * @return self
      */

+ 4 - 4
api-test/client/lib/Model/GetApiV3TipitakaChapters200ResponseDataInnerPathInner.php → api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInner.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * GetApiV3TipitakaChapters200ResponseDataInnerPathInner
+ * GetApiV3TipitakaTitles200ResponseDataInnerPathInner
  *
  * PHP version 8.1
  *
@@ -32,7 +32,7 @@ use \ArrayAccess;
 use \WikipaliApi\ObjectSerializer;
 
 /**
- * GetApiV3TipitakaChapters200ResponseDataInnerPathInner Class Doc Comment
+ * GetApiV3TipitakaTitles200ResponseDataInnerPathInner Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
@@ -40,7 +40,7 @@ use \WikipaliApi\ObjectSerializer;
  * @link     https://openapi-generator.tech
  * @implements \ArrayAccess<string, mixed>
  */
-class GetApiV3TipitakaChapters200ResponseDataInnerPathInner implements ModelInterface, ArrayAccess, \JsonSerializable
+class GetApiV3TipitakaTitles200ResponseDataInnerPathInner implements ModelInterface, ArrayAccess, \JsonSerializable
 {
     public const DISCRIMINATOR = null;
 
@@ -49,7 +49,7 @@ class GetApiV3TipitakaChapters200ResponseDataInnerPathInner implements ModelInte
      *
      * @var string
      */
-    protected static $openAPIModelName = 'get_api_v3_tipitaka_chapters_200_response_data_inner_path_inner';
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_titles_200_response_data_inner_path_inner';
 
     /**
      * Array of property to type mappings. Used for (de)serialization

+ 4 - 4
api-test/client/lib/Model/GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner.php → api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner
+ * GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner
  *
  * PHP version 8.1
  *
@@ -32,7 +32,7 @@ use \ArrayAccess;
 use \WikipaliApi\ObjectSerializer;
 
 /**
- * GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner Class Doc Comment
+ * GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
@@ -40,7 +40,7 @@ use \WikipaliApi\ObjectSerializer;
  * @link     https://openapi-generator.tech
  * @implements \ArrayAccess<string, mixed>
  */
-class GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner implements ModelInterface, ArrayAccess, \JsonSerializable
+class GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner implements ModelInterface, ArrayAccess, \JsonSerializable
 {
     public const DISCRIMINATOR = null;
 
@@ -49,7 +49,7 @@ class GetApiV3TipitakaChapters200ResponseDataInnerTranslationsInner implements M
      *
      * @var string
      */
-    protected static $openAPIModelName = 'get_api_v3_tipitaka_chapters_200_response_data_inner_translations_inner';
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_titles_200_response_data_inner_translations_inner';
 
     /**
      * Array of property to type mappings. Used for (de)serialization

+ 3 - 3
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.php

@@ -64,7 +64,7 @@ class GetApiV3TipitakaWordParagraphs200ResponseDataInner implements ModelInterfa
         'hits' => 'int',
         'title' => 'string',
         'level' => 'int',
-        'path' => '\WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]',
+        'path' => '\WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]',
         'text' => 'string',
         'refs' => '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner[]'
     ];
@@ -544,7 +544,7 @@ class GetApiV3TipitakaWordParagraphs200ResponseDataInner implements ModelInterfa
     /**
      * Gets path
      *
-     * @return \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]|null
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null
      */
     public function getPath()
     {
@@ -554,7 +554,7 @@ class GetApiV3TipitakaWordParagraphs200ResponseDataInner implements ModelInterfa
     /**
      * Sets path
      *
-     * @param \WikipaliApi\Model\GetApiV3TipitakaChapters200ResponseDataInnerPathInner[]|null $path path
+     * @param \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null $path path
      *
      * @return self
      */

+ 10 - 7
api-v13/app/Http/Controllers/V3/TipitakaTitleController.php

@@ -3,19 +3,22 @@
 namespace App\Http\Controllers\V3;
 
 use App\Http\Controllers\Controller;
-use App\Http\Requests\V3\IndexTipitakaChapterRequest;
-use App\Http\Resources\V3\TipitakaChapterResource;
-use App\Services\V3\TipitakaChapterService;
+use App\Http\Requests\V3\IndexTipitakaTitleRequest;
+use App\Http\Resources\V3\TipitakaTitleResource;
+use App\Services\V3\TipitakaTitleService;
 
 /**
  * 三藏章节标题:按名字找章节,或列出一本书的全部标题。
  *
  * 取代 `GET /v2/search-title-index`(`SearchTitleController@index`)。v2 那份只回标题文字、
  * 不带坐标,在 dashboard-v4 下线前原样保留,不要改动。
+ *
+ * 2026-11-19 前叫 `GET /v3/tipitaka-chapters`(`TipitakaChapterController`),名字容易误会成章节正文,
+ * 改成 titles;旧路径已删除。
  */
-class TipitakaChapterController extends Controller
+class TipitakaTitleController extends Controller
 {
-    public function __construct(private readonly TipitakaChapterService $chapters) {}
+    public function __construct(private readonly TipitakaTitleService $chapters) {}
 
     /**
      * 找章节
@@ -42,9 +45,9 @@ class TipitakaChapterController extends Controller
      * @queryParam page integer 页码。Default: 1
      * @queryParam per_page integer 每页数量,最大 1000。Default: 50
      */
-    public function __invoke(IndexTipitakaChapterRequest $request)
+    public function __invoke(IndexTipitakaTitleRequest $request)
     {
-        return TipitakaChapterResource::collection($this->chapters->search(
+        return TipitakaTitleResource::collection($this->chapters->search(
             $request->safe()->only(['q', 'book', 'para', 'layer', 'max_level']),
             $request->integer('page', 1),
             $request->integer('per_page', 50),

+ 2 - 2
api-v13/app/Http/Requests/V3/IndexTipitakaTitleRequest.php

@@ -5,12 +5,12 @@ namespace App\Http\Requests\V3;
 use Illuminate\Foundation\Http\FormRequest;
 
 /**
- * `GET /v3/tipitaka-chapters` 的入参。
+ * `GET /v3/tipitaka-titles` 的入参。
  *
  * 全是过滤条件,但至少要给 `q` 或 `book` 之一:不加条件就是 3.7 万条标题全表,没人会翻。
  * 两者可以同时给(在一本书里按名字找)。`para` 是 book 里的一章,只列它下面的标题,所以要和 book 一起给。
  */
-class IndexTipitakaChapterRequest extends FormRequest
+class IndexTipitakaTitleRequest extends FormRequest
 {
     /** layer 的取值:根本典、义注、复注、其他 */
     public const LAYERS = ['mula', 'atthakatha', 'tika', 'anna'];

+ 3 - 3
api-v13/app/Http/Resources/V3/TipitakaTitleResource.php

@@ -2,19 +2,19 @@
 
 namespace App\Http\Resources\V3;
 
-use App\Services\V3\TipitakaChapterService;
+use App\Services\V3\TipitakaTitleService;
 use Illuminate\Http\Request;
 
 /**
  * 三藏里的一个章节标题。
  *
- * 载荷是 {@see TipitakaChapterService::search()} 组好的数组,不查库。底层是 pali_texts 中
+ * 载荷是 {@see TipitakaTitleService::search()} 组好的数组,不查库。底层是 pali_texts 中
  * level < 8 的一行;译名来自公开 channel 的 progress_chapters.title。
  *
  * 类型核对自 information_schema:pali_texts.book / paragraph / level / chapter_len /
  * chapter_strlen / parent / prev_chapter / next_chapter 都是 integer,toc 是 text,path 是 json。
  */
-class TipitakaChapterResource extends BaseResource
+class TipitakaTitleResource extends BaseResource
 {
     /**
      * @param  Request  $request

+ 1 - 1
api-v13/app/Services/V3/TipitakaBookService.php

@@ -14,7 +14,7 @@ use Illuminate\Support\Collection;
  */
 class TipitakaBookService
 {
-    /** 书的 tag → layer(同 TipitakaChapterService),一本书有多个时按这个顺序取第一个 */
+    /** 书的 tag → layer(同 TipitakaTitleService),一本书有多个时按这个顺序取第一个 */
     private const LAYER_TAGS = ['mūla' => 'mula', 'aṭṭhakathā' => 'atthakatha', 'ṭīkā' => 'tika', 'añña' => 'anna'];
 
     /**

+ 2 - 2
api-v13/app/Services/V3/TipitakaTitleService.php

@@ -30,13 +30,13 @@ use Illuminate\Pagination\LengthAwarePaginator;
  * 插件 `locate` 改调 `/v3/search`(granularity=chapter),计划见 `documents/search-recall.md` 4.6。
  * 届时这里的 PHP 匹配只保留给 v2 替代与小规模调用,不再扩展。
  */
-class TipitakaChapterService
+class TipitakaTitleService
 {
     /** 只有 level < 8 的段落是标题(与 v2、IndexTipitaka 同口径) */
     private const MAX_TITLE_LEVEL = 8;
 
     /** 缓存键带版本号:catalog 的结构变了就改版本号,不用等过期 */
-    private const CATALOG_KEY = '/v3/tipitaka-chapters/catalog/v1';
+    private const CATALOG_KEY = '/v3/tipitaka-titles/catalog/v1';
 
     private const CATALOG_TTL = 86400;
 

+ 3 - 3
api-v13/documents/search-recall.md

@@ -123,9 +123,9 @@
   连音(`koṭisanthāra`、`vassaṃvutthānaṃ`)会漏。`wbw_templates` 里已有拆好的词与词根,
   可给每段写一个词根字段进索引,比维护同义词表可靠。需要重建索引。
 
-### 4.6 章节标题检索走 OpenSearch(取代 `/v3/tipitaka-chapters` 里的 PHP 匹配)
+### 4.6 章节标题检索走 OpenSearch(取代 `/v3/tipitaka-titles` 里的 PHP 匹配)
 
-2026-11-11 新建了 `GET /v3/tipitaka-chapters`(取代 v2 `search-title-index`),`q` 的容错匹配写在 PHP 里
+2026-11-11 新建了 `GET /v3/tipitaka-chapters`(11-19 改名 `tipitaka-titles`)(取代 v2 `search-title-index`),`q` 的容错匹配写在 PHP 里
 (`App\Services\V3\TipitakaChapterService`:去变音符号、去序号与丛书缩写、三字母粗筛 + 编辑距离,
 外加公开译本的中文章节名),**只用来先验证「按章节名定位」的效果**。验证结果见 agent-poc
 `agent-tuning/docs/retrieval-recall-2026-11.md` 第七节:插件 `locate` 一条路就让 148 道真实问题里
@@ -153,7 +153,7 @@
 
 做法:新 `search_mode=title`(或 `granularity=chapter` 时的默认),`OpenSearchService` 里建查询;插件 `locate`
 改调 `/v3/search`,输出保持不变。**验收**:用 `agent-tuning/eval/recall/eval_navigate.py` + `eval_judge.py`
-重跑,locate 一路不低于 PHP 版(留出集 54/148、调参集 10/11)。`/v3/tipitaka-chapters` 继续作为 v2 替代与
+重跑,locate 一路不低于 PHP 版(留出集 54/148、调参集 10/11)。`/v3/tipitaka-titles`(原名 tipitaka-chapters) 继续作为 v2 替代与
 `toc`(按书列标题)的数据源,PHP 匹配不再扩展。
 
 ## 复现

+ 5 - 3
api-v13/routes/v3/tipitaka.php

@@ -22,13 +22,13 @@ use App\Http\Controllers\V3\PaliWordFormController;
 use App\Http\Controllers\V3\PaliWordSuggestionController;
 use App\Http\Controllers\V3\TipitakaChannelController;
 use App\Http\Controllers\V3\TipitakaChapterChannelController;
-use App\Http\Controllers\V3\TipitakaChapterController;
 use App\Http\Controllers\V3\TipitakaDiscussionController;
 use App\Http\Controllers\V3\TipitakaPageNumberController;
 use App\Http\Controllers\V3\TipitakaParagraphChannelController;
 use App\Http\Controllers\V3\TipitakaReadingController;
 use App\Http\Controllers\V3\TipitakaRelatedParagraphAggregateController;
 use App\Http\Controllers\V3\TipitakaRelatedParagraphController;
+use App\Http\Controllers\V3\TipitakaTitleController;
 use App\Http\Controllers\V3\TipitakaWordParagraphAggregateController;
 use App\Http\Controllers\V3\TipitakaWordParagraphController;
 use Illuminate\Support\Facades\Route;
@@ -57,8 +57,10 @@ Route::get('tipitaka-paragraph-channels/{book}/{para}', TipitakaParagraphChannel
 Route::get('tipitaka-channels', TipitakaChannelController::class)
     ->name('tipitaka-channels.index');
 
-Route::get('tipitaka-chapters', TipitakaChapterController::class)
-    ->name('tipitaka-chapters.index');
+// 章节标题:按名字找章节(容错),或列出一本书的标题目录。取代 v2 search-title-index。
+// 2026-11-19 前叫 tipitaka-chapters(容易误会成章节正文,改名)
+Route::get('tipitaka-titles', TipitakaTitleController::class)
+    ->name('tipitaka-titles.index');
 
 // 段落关联关系:查询(原 v2 related-paragraph)+ 聚合(book_name 列表 / 某 book_name 的 cs_para)。
 Route::get('tipitaka-related-paragraphs/aggregate', [TipitakaRelatedParagraphAggregateController::class, 'index'])

+ 19 - 19
api-v13/tests/Feature/TipitakaTitleV3Test.php

@@ -5,14 +5,14 @@ use App\Models\PaliText;
 use App\Models\ProgressChapter;
 use App\Models\Tag;
 use App\Models\TagMap;
-use App\Services\V3\TipitakaChapterService;
+use App\Services\V3\TipitakaTitleService;
 use Illuminate\Foundation\Testing\RefreshDatabase;
 use Illuminate\Support\Str;
 
 uses(RefreshDatabase::class);
 
 /*
- * GET /v3/tipitaka-chapters:按名字找章节(容错)、列出一本书的标题。
+ * GET /v3/tipitaka-titles:按名字找章节(容错)、列出一本书的标题。
  *
  * 这里断言的是形状而非契约(spectator 未安装,见 v3-resource skill 第 3 步)。
  */
@@ -91,7 +91,7 @@ function tcV3Fixture(): void
 it('lists a book in canonical order with coordinates and size', function () {
     tcV3Fixture();
 
-    $response = $this->getJson('/api/v3/tipitaka-chapters?book=94')->assertOk();
+    $response = $this->getJson('/api/v3/tipitaka-titles?book=94')->assertOk();
 
     expect(array_column($response->json('data'), 'para'))->toBe([3, 287, 585, 663]);
     $sutta = $response->json('data.1');
@@ -107,11 +107,11 @@ it('lists a book in canonical order with coordinates and size', function () {
 it('narrows a book listing to one chapter and by level', function () {
     tcV3Fixture();
 
-    $this->getJson('/api/v3/tipitaka-chapters?book=94&para=287')
+    $this->getJson('/api/v3/tipitaka-titles?book=94&para=287')
         ->assertOk()
         ->assertJsonPath('data.*.para', [287, 585]);
 
-    $this->getJson('/api/v3/tipitaka-chapters?book=94&max_level=2')
+    $this->getJson('/api/v3/tipitaka-titles?book=94&max_level=2')
         ->assertOk()
         ->assertJsonPath('data.*.para', [3, 287, 663]);
 });
@@ -119,7 +119,7 @@ it('narrows a book listing to one chapter and by level', function () {
 it('finds a title regardless of case and diacritics, canonical text first', function () {
     tcV3Fixture();
 
-    $data = $this->getJson('/api/v3/tipitaka-chapters?q=MAHAPARINIBBANA')->assertOk()->json('data');
+    $data = $this->getJson('/api/v3/tipitaka-titles?q=MAHAPARINIBBANA')->assertOk()->json('data');
 
     expect(array_map(fn ($r) => [$r['book'], $r['para'], $r['score']], $data))
         ->toBe([[94, 287, 0.95], [104, 420, 0.95]]);
@@ -128,25 +128,25 @@ it('finds a title regardless of case and diacritics, canonical text first', func
 it('tolerates misspellings and ranks the closer title first', function () {
     tcV3Fixture();
 
-    $typo = $this->getJson('/api/v3/tipitaka-chapters?q=mahaparinibanasuta')->assertOk()->json('data');
+    $typo = $this->getJson('/api/v3/tipitaka-titles?q=mahaparinibanasuta')->assertOk()->json('data');
     expect($typo[0]['para'])->toBe(287)
         ->and($typo[0]['score'])->toBeLessThan(0.86)->toBeGreaterThan(0.6);
 
-    $ananda = $this->getJson('/api/v3/tipitaka-chapters?q=anandatheragatha')->assertOk()->json('data');
+    $ananda = $this->getJson('/api/v3/tipitaka-titles?q=anandatheragatha')->assertOk()->json('data');
     expect($ananda[0]['para'])->toBe(3809);
 });
 
 it('finds a chapter by its public translated title only', function () {
     tcV3Fixture();
 
-    $this->getJson('/api/v3/tipitaka-chapters?q='.urlencode('大般涅槃'))
+    $this->getJson('/api/v3/tipitaka-titles?q='.urlencode('大般涅槃'))
         ->assertOk()
         ->assertJsonPath('data.*.para', [287]);
 
-    $this->getJson('/api/v3/tipitaka-chapters?q='.urlencode('私密译名'))
+    $this->getJson('/api/v3/tipitaka-titles?q='.urlencode('私密译名'))
         ->assertOk()
         ->assertJsonCount(0, 'data');
-    $this->getJson('/api/v3/tipitaka-chapters?book=94&para=663')
+    $this->getJson('/api/v3/tipitaka-titles?book=94&para=663')
         ->assertOk()
         ->assertJsonPath('data.0.translations', []);
 });
@@ -154,13 +154,13 @@ it('finds a chapter by its public translated title only', function () {
 it('filters by layer', function () {
     tcV3Fixture();
 
-    $this->getJson('/api/v3/tipitaka-chapters?q=mahaparinibbana&layer=atthakatha')
+    $this->getJson('/api/v3/tipitaka-titles?q=mahaparinibbana&layer=atthakatha')
         ->assertOk()
         ->assertJsonPath('data.*.book', [104]);
 });
 
 it('rejects a query without q or book, para without book, and unknown layers', function (string $query, string $field) {
-    $this->getJson('/api/v3/tipitaka-chapters'.$query)
+    $this->getJson('/api/v3/tipitaka-titles'.$query)
         ->assertUnprocessable()
         ->assertJsonValidationErrors($field);
 })->with([
@@ -171,10 +171,10 @@ it('rejects a query without q or book, para without book, and unknown layers', f
 ]);
 
 it('scores tiers so that misspellings never outrank correct spellings', function () {
-    expect(TipitakaChapterService::score('mahaparinibbana', 'mahaparinibbana')[0])->toBe(1.0)
-        ->and(TipitakaChapterService::score('mahaparinibbana', 'mahaparinibbanasuttam')[0])->toBe(0.95)
-        ->and(TipitakaChapterService::score('parinibbana', 'mahaparinibbanasuttam')[0])->toBe(0.9)
-        ->and(TipitakaChapterService::score('mahaparinibanasuta', 'mahaparinibbanasuttam')[0])->toBeLessThanOrEqual(0.85)
-        ->and(TipitakaChapterService::score('vessantara', 'mahaparinibbanasuttam')[0])->toBe(0.0)
-        ->and(TipitakaChapterService::normalize('(DN) 3. Mahāparinibbānasuttaṃ'))->toBe('mahaparinibbanasuttam');
+    expect(TipitakaTitleService::score('mahaparinibbana', 'mahaparinibbana')[0])->toBe(1.0)
+        ->and(TipitakaTitleService::score('mahaparinibbana', 'mahaparinibbanasuttam')[0])->toBe(0.95)
+        ->and(TipitakaTitleService::score('parinibbana', 'mahaparinibbanasuttam')[0])->toBe(0.9)
+        ->and(TipitakaTitleService::score('mahaparinibanasuta', 'mahaparinibbanasuttam')[0])->toBeLessThanOrEqual(0.85)
+        ->and(TipitakaTitleService::score('vessantara', 'mahaparinibbanasuttam')[0])->toBe(0.0)
+        ->and(TipitakaTitleService::normalize('(DN) 3. Mahāparinibbānasuttaṃ'))->toBe('mahaparinibbanasuttam');
 });

+ 3 - 3
dashboard-test/src/tests/search.spec.ts

@@ -3,7 +3,7 @@ import { collect } from '../lib/collect.js';
 
 /**
  * workspace 搜索(取代 v4 的 /search 页):主导航「搜索」弹窗 + 整页 /workspace/search。
- * 全文走 /v3/search(category 分面),标题走 /v3/tipitaka-chapters?q=;定义走 /v3/tipitaka-word-paragraphs,页码走 /v3/tipitaka-page-numbers(输入页码时全文不查)。
+ * 全文走 /v3/search(category 分面),标题走 /v3/tipitaka-titles?q=;定义走 /v3/tipitaka-word-paragraphs,页码走 /v3/tipitaka-page-numbers(输入页码时全文不查)。
  */
 const CHANNEL = '4a356b64-8e6b-414a-ae81-7dfa2d5b35b6';
 const READING = `workspace/tipitaka/chapter/83-150?channel=${CHANNEL}`;
@@ -27,7 +27,7 @@ test('主导航打开搜索弹窗:全文与标题同时查询,按层级筛
   const dialog = await openModal(page);
 
   const fts = searchResponse(page);
-  const chapters = page.waitForResponse((r) => new URL(r.url()).pathname === '/api/v3/tipitaka-chapters');
+  const chapters = page.waitForResponse((r) => new URL(r.url()).pathname === '/api/v3/tipitaka-titles');
   await dialog.getByRole('combobox').fill('vitakka');
   await dialog.getByRole('combobox').press('Enter');
 
@@ -77,7 +77,7 @@ test('标题标签页按层级筛选;结果链接带上当前 channel,在新
   await dialog.getByRole('tab', { name: /标题/ }).click();
 
   const mula = page.waitForResponse(
-    (r) => new URL(r.url()).pathname === '/api/v3/tipitaka-chapters' && new URL(r.url()).searchParams.get('layer') === 'mula',
+    (r) => new URL(r.url()).pathname === '/api/v3/tipitaka-titles' && new URL(r.url()).searchParams.get('layer') === 'mula',
   );
   await dialog.getByTitle('根本', { exact: true }).click();
   const body = await (await mula).json();

+ 105 - 105
dashboard-v6/src/api/schema.d.ts

@@ -5162,7 +5162,7 @@ export interface paths {
         /**
          * 列出 search-title-index
          * @deprecated
-         * @description 已被 `GET /v3/tipitaka-chapters` 取代(带坐标、容错匹配、可按书列出全部标题),
+         * @description 已被 `GET /v3/tipitaka-titles` 取代(带坐标、容错匹配、可按书列出全部标题),
          *     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
          */
         get: operations["get_api_v2_search_title_index"];
@@ -9393,36 +9393,6 @@ export interface paths {
         patch?: never;
         trace?: never;
     };
-    "/v3/tipitaka-chapters": {
-        parameters: {
-            query?: never;
-            header?: never;
-            path?: never;
-            cookie?: never;
-        };
-        /**
-         * 找章节
-         * @description 两种用法,可以叠加:
-         *     - **按名字找**(给 `q`):巴利名不分大小写、变音符号可有可无(`mahaparinibbana`),可以只写
-         *     名字的一部分,拼错一两个字母也能找到;也能用公开译本里的章节译名(如「大般涅槃经」)。
-         *     按匹配度排序,带 `score`(相等 1、开头相同 0.95、包含 0.9,拼错的按相似度最高 0.85);同一档里根本典在前,再按与整个标题的接近度、大章在前。
-         *     - **列出一本书的标题**(给 `book`,不给 `q`):按经文顺序。再给 `para` 只列那一章下面的;
-         *     `max_level` 限制层级深浅。
-         *     `layer` 是这本书属于根本典(mula)、义注(atthakatha)、复注(tika)还是其他(anna);
-         *     `paragraphs` / `chars` 是这一章的段数与字符数;`parent` / `prev` / `next` 是同一本书里的段号,
-         *     没有为 null;`path` 是从丛书到上一级的路径(不含本章)。
-         *
-         *     实现:`V3\TipitakaChapterController@__invoke`
-         */
-        get: operations["get_api_v3_tipitaka_chapters"];
-        put?: never;
-        post?: never;
-        delete?: never;
-        options?: never;
-        head?: never;
-        patch?: never;
-        trace?: never;
-    };
     "/v3/tipitaka-discussions/{channel}": {
         parameters: {
             query?: never;
@@ -9593,6 +9563,36 @@ export interface paths {
         patch?: never;
         trace?: never;
     };
+    "/v3/tipitaka-titles": {
+        parameters: {
+            query?: never;
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        /**
+         * 找章节
+         * @description 两种用法,可以叠加:
+         *     - **按名字找**(给 `q`):巴利名不分大小写、变音符号可有可无(`mahaparinibbana`),可以只写
+         *     名字的一部分,拼错一两个字母也能找到;也能用公开译本里的章节译名(如「大般涅槃经」)。
+         *     按匹配度排序,带 `score`(相等 1、开头相同 0.95、包含 0.9,拼错的按相似度最高 0.85);同一档里根本典在前,再按与整个标题的接近度、大章在前。
+         *     - **列出一本书的标题**(给 `book`,不给 `q`):按经文顺序。再给 `para` 只列那一章下面的;
+         *     `max_level` 限制层级深浅。
+         *     `layer` 是这本书属于根本典(mula)、义注(atthakatha)、复注(tika)还是其他(anna);
+         *     `paragraphs` / `chars` 是这一章的段数与字符数;`parent` / `prev` / `next` 是同一本书里的段号,
+         *     没有为 null;`path` 是从丛书到上一级的路径(不含本章)。
+         *
+         *     实现:`V3\TipitakaTitleController@__invoke`
+         */
+        get: operations["get_api_v3_tipitaka_titles"];
+        put?: never;
+        post?: never;
+        delete?: never;
+        options?: never;
+        head?: never;
+        patch?: never;
+        trace?: never;
+    };
     "/v3/tipitaka-word-paragraphs": {
         parameters: {
             query?: never;
@@ -41968,80 +41968,6 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
         };
     };
-    get_api_v3_tipitaka_chapters: {
-        parameters: {
-            query?: {
-                /** @description 页码 */
-                page?: number;
-                /** @description 每页数量,最大 1000 */
-                per_page?: number;
-                /**
-                 * @description 章节名:巴利名或译名,不给 book 时必填
-                 * @example mahaparinibbana
-                 */
-                q?: string;
-                /**
-                 * @description 书号,不给 q 时必填
-                 * @example 94
-                 */
-                book?: number;
-                /**
-                 * @description 只列 book 里这一章下面的标题(含它自己),要和 book 一起给
-                 * @example 287
-                 */
-                para?: number;
-                /** @description 只要某几层,逗号分隔 */
-                layer?: "mula" | "atthakatha" | "tika" | "anna";
-                /**
-                 * @description 只要层级不深于它的标题(1 是书名)
-                 * @example 3
-                 */
-                max_level?: number;
-            };
-            header?: never;
-            path?: never;
-            cookie?: never;
-        };
-        requestBody?: never;
-        responses: {
-            /** @description 成功 */
-            200: {
-                headers: {
-                    [name: string]: unknown;
-                };
-                content: {
-                    "application/json": {
-                        data?: {
-                            book?: number;
-                            para?: number;
-                            level?: number;
-                            title?: string;
-                            translations?: {
-                                lang?: string;
-                                title?: string;
-                            }[];
-                            layer?: string;
-                            paragraphs?: number;
-                            chars?: number;
-                            parent?: number | null;
-                            prev?: number | null;
-                            next?: number | null;
-                            path?: {
-                                book?: number;
-                                para?: number;
-                                title?: string;
-                                level?: number;
-                            }[];
-                            /** @description 仅在部分查询口径下返回。 */
-                            score?: number;
-                        }[];
-                        meta?: components["schemas"]["PaginationMeta"];
-                    };
-                };
-            };
-            422: components["responses"]["ProblemValidation"];
-        };
-    };
     get_api_v3_tipitaka_discussions_channel_: {
         parameters: {
             query?: {
@@ -42509,6 +42435,80 @@ export interface operations {
             422: components["responses"]["ProblemValidation"];
         };
     };
+    get_api_v3_tipitaka_titles: {
+        parameters: {
+            query?: {
+                /** @description 页码 */
+                page?: number;
+                /** @description 每页数量,最大 1000 */
+                per_page?: number;
+                /**
+                 * @description 章节名:巴利名或译名,不给 book 时必填
+                 * @example mahaparinibbana
+                 */
+                q?: string;
+                /**
+                 * @description 书号,不给 q 时必填
+                 * @example 94
+                 */
+                book?: number;
+                /**
+                 * @description 只列 book 里这一章下面的标题(含它自己),要和 book 一起给
+                 * @example 287
+                 */
+                para?: number;
+                /** @description 只要某几层,逗号分隔 */
+                layer?: "mula" | "atthakatha" | "tika" | "anna";
+                /**
+                 * @description 只要层级不深于它的标题(1 是书名)
+                 * @example 3
+                 */
+                max_level?: number;
+            };
+            header?: never;
+            path?: never;
+            cookie?: never;
+        };
+        requestBody?: never;
+        responses: {
+            /** @description 成功 */
+            200: {
+                headers: {
+                    [name: string]: unknown;
+                };
+                content: {
+                    "application/json": {
+                        data?: {
+                            book?: number;
+                            para?: number;
+                            level?: number;
+                            title?: string;
+                            translations?: {
+                                lang?: string;
+                                title?: string;
+                            }[];
+                            layer?: string;
+                            paragraphs?: number;
+                            chars?: number;
+                            parent?: number | null;
+                            prev?: number | null;
+                            next?: number | null;
+                            path?: {
+                                book?: number;
+                                para?: number;
+                                title?: string;
+                                level?: number;
+                            }[];
+                            /** @description 仅在部分查询口径下返回。 */
+                            score?: number;
+                        }[];
+                        meta?: components["schemas"]["PaginationMeta"];
+                    };
+                };
+            };
+            422: components["responses"]["ProblemValidation"];
+        };
+    };
     get_api_v3_tipitaka_word_paragraphs: {
         parameters: {
             query: {

+ 10 - 10
dashboard-v6/src/api/tipitaka-search.ts

@@ -2,7 +2,7 @@
 //
 // workspace 搜索面板用到的 v3 检索接口:
 // - 全文:`GET /v3/search`(OpenSearch,三藏段落)
-// - 标题:`GET /v3/tipitaka-chapters?q=`(章节名定位)
+// - 标题:`GET /v3/tipitaka-titles?q=`(章节名定位)
 import { api, unwrapQuiet } from "./client";
 import type { paths } from "./schema";
 
@@ -53,24 +53,24 @@ export const searchParagraphs = async (p: IFullTextParams) =>
 
 /* ─── 标题 ─── */
 
-type ChapterOp = paths["/v3/tipitaka-chapters"]["get"];
-type ChapterQuery = NonNullable<ChapterOp["parameters"]["query"]>;
-type ChapterBody = ChapterOp["responses"][200]["content"]["application/json"];
+type TitleOp = paths["/v3/tipitaka-titles"]["get"];
+type TitleQuery = NonNullable<TitleOp["parameters"]["query"]>;
+type TitleBody = TitleOp["responses"][200]["content"]["application/json"];
 
-export type ChapterLayer = NonNullable<ChapterQuery["layer"]>;
-export type ChapterHit = NonNullable<ChapterBody["data"]>[number];
+export type TipitakaLayer = NonNullable<TitleQuery["layer"]>;
+export type TitleHit = NonNullable<TitleBody["data"]>[number];
 
-export interface IChapterParams {
+export interface ITitleParams {
   q: string;
-  layer?: ChapterLayer;
+  layer?: TipitakaLayer;
   page: number;
   perPage: number;
 }
 
 /** 按章节名找章节(巴利名或译名,容错拼写与变音符号) */
-export const searchChapters = async (p: IChapterParams) =>
+export const searchTitles = async (p: ITitleParams) =>
   unwrapQuiet(
-    await api.GET("/v3/tipitaka-chapters", {
+    await api.GET("/v3/tipitaka-titles", {
       params: {
         query: {
           q: p.q,

+ 3 - 3
dashboard-v6/src/features/search/LayerTag.tsx

@@ -1,8 +1,8 @@
 import { Tag } from "antd";
 import { useIntl } from "react-intl";
-import type { ChapterLayer } from "../../api/tipitaka-search";
+import type { TipitakaLayer } from "../../api/tipitaka-search";
 
-const COLOR: Record<ChapterLayer, string> = {
+const COLOR: Record<TipitakaLayer, string> = {
   mula: "green",
   atthakatha: "blue",
   tika: "magenta",
@@ -17,7 +17,7 @@ const LayerTag = ({ layer }: { layer?: string | null }) => {
   }
   return (
     <Tag
-      color={COLOR[layer as ChapterLayer]}
+      color={COLOR[layer as TipitakaLayer]}
       bordered={false}
       style={{ marginInlineEnd: 0 }}
     >

+ 5 - 5
dashboard-v6/src/features/search/SearchPanel.tsx

@@ -8,7 +8,7 @@ import PageTab from "./PageTab";
 import SearchInput from "./SearchInput";
 import TitleTab from "./TitleTab";
 import {
-  useChapterSearch,
+  useTitleSearch,
   useFullTextSearch,
   usePageNumbers,
   useWordBooks,
@@ -38,7 +38,7 @@ interface IWidget {
  *
  * - 全文:`/v3/search`,按分类(层级 / 藏别 / 其他)筛选
  * - 定义:`/v3/pali-word-forms` 展开词形 → `/v3/tipitaka-word-paragraphs`(+ `/aggregate` 按书统计)
- * - 标题:`/v3/tipitaka-chapters?q=`
+ * - 标题:`/v3/tipitaka-titles?q=`
  * - 页码:`/v3/tipitaka-page-numbers/{page}`,PTS / 缅甸版 / VRI / 泰国版 / 其他与 CS 段落号
  *
  * 全文、定义、标题同时查询,标签上直接显示命中数。
@@ -72,7 +72,7 @@ const SearchPanel = ({
     state.category,
     state.page,
   );
-  const chapters = useChapterSearch(state.q, state.layer, state.titlePage);
+  const titles = useTitleSearch(state.q, state.layer, state.titlePage);
   const pageQuery = useMemo(() => parsePageQuery(state.q), [state.q]);
   const pageNumbers = usePageNumbers(pageQuery);
 
@@ -152,7 +152,7 @@ const SearchPanel = ({
     );
   const totals: Partial<Record<SearchTab, number | undefined>> = {
     fulltext: state.q && !isPageQuery ? fullText.meta?.total : undefined,
-    title: state.q ? chapters.meta?.total : undefined,
+    title: state.q ? titles.meta?.total : undefined,
     page: pageQuery ? pageNumbers.meta?.total : undefined,
     definition:
       state.q && words.length ? wordParagraphs.meta?.total : undefined,
@@ -192,7 +192,7 @@ const SearchPanel = ({
         return (
           <TitleTab
             state={state}
-            result={chapters}
+            result={titles}
             onChange={onChange}
             channel={channel}
             newTab={newTab}

+ 7 - 7
dashboard-v6/src/features/search/TitleTab.tsx

@@ -1,25 +1,25 @@
 import { Alert, Flex, Segmented, Table, Typography, theme } from "antd";
 import { useIntl } from "react-intl";
 import { Link } from "react-router";
-import type { ChapterHit, ChapterLayer } from "../../api/tipitaka-search";
+import type { TitleHit, TipitakaLayer } from "../../api/tipitaka-search";
 import LayerTag from "./LayerTag";
-import { TITLE_PER_PAGE, type useChapterSearch } from "./hooks";
+import { TITLE_PER_PAGE, type useTitleSearch } from "./hooks";
 import type { ISearchState } from "./state";
 
 const { Text } = Typography;
 const PALI_FONT = '"Noto Serif", Georgia, "Times New Roman", serif';
-const LAYERS: ChapterLayer[] = ["mula", "atthakatha", "tika", "anna"];
+const LAYERS: TipitakaLayer[] = ["mula", "atthakatha", "tika", "anna"];
 
 interface IWidget {
   state: ISearchState;
-  result: ReturnType<typeof useChapterSearch>;
+  result: ReturnType<typeof useTitleSearch>;
   onChange: (patch: Partial<ISearchState>) => void;
   channel?: string | null;
   /** 链接在新标签页打开(在弹窗等浮动容器里时) */
   newTab?: boolean;
 }
 
-/** 标题标签页:按章节名定位(/v3/tipitaka-chapters?q=),可按层级筛选 */
+/** 标题标签页:按章节名定位(/v3/tipitaka-titles?q=),可按层级筛选 */
 const TitleTab = ({ state, result, onChange, channel, newTab }: IWidget) => {
   const intl = useIntl();
   const { token } = theme.useToken();
@@ -50,7 +50,7 @@ const TitleTab = ({ state, result, onChange, channel, newTab }: IWidget) => {
         <Text type="secondary">
           {intl.formatMessage({ id: "search.facet.layer" })}
         </Text>
-        <Segmented<ChapterLayer | "">
+        <Segmented<TipitakaLayer | "">
           size="small"
           value={state.layer ?? ""}
           options={[
@@ -79,7 +79,7 @@ const TitleTab = ({ state, result, onChange, channel, newTab }: IWidget) => {
             message={error.message}
           />
         ) : (
-          <Table<ChapterHit>
+          <Table<TitleHit>
             size="small"
             loading={loading}
             dataSource={data}

+ 3 - 3
dashboard-v6/src/features/search/categories.ts

@@ -1,6 +1,6 @@
 // 全文检索的 category 分面是书的标签,藏别、层级、书系混在一个列表里。
 // 这里把它分成三组显示;过滤时仍然都放进 category 参数(后端要求全部命中)。
-import type { ChapterLayer } from "../../api/tipitaka-search";
+import type { TipitakaLayer } from "../../api/tipitaka-search";
 
 export interface ICategoryOption {
   /** 索引里的标签值 */
@@ -35,14 +35,14 @@ export const isLayerCategory = (key: string): boolean => LAYER_KEYS.has(key);
 export const isPitakaCategory = (key: string): boolean => PITAKA_KEYS.has(key);
 
 /** 段落的 category → 章节接口的 layer 值(用于统一的层级标签) */
-const CATEGORY_TO_LAYER: Record<string, ChapterLayer> = {
+const CATEGORY_TO_LAYER: Record<string, TipitakaLayer> = {
   mūla: "mula",
   aṭṭhakathā: "atthakatha",
   ṭīkā: "tika",
   añña: "anna",
 };
 
-export const layerOf = (category?: string[]): ChapterLayer | undefined => {
+export const layerOf = (category?: string[]): TipitakaLayer | undefined => {
   for (const c of category ?? []) {
     if (CATEGORY_TO_LAYER[c]) return CATEGORY_TO_LAYER[c];
   }

+ 7 - 7
dashboard-v6/src/features/search/hooks.ts

@@ -1,13 +1,13 @@
 import { useEffect, useState } from "react";
 import {
   aggregateWordBooks,
-  searchChapters,
+  searchTitles,
   searchPageNumbers,
   searchParagraphs,
   searchWordParagraphs,
   type BoldScope,
-  type ChapterHit,
-  type ChapterLayer,
+  type TitleHit,
+  type TipitakaLayer,
   type PageNumberHit,
   type SearchHit,
   type SearchMeta,
@@ -80,16 +80,16 @@ export const useFullTextSearch = (
   );
 };
 
-export const useChapterSearch = (
+export const useTitleSearch = (
   q: string,
-  layer: ChapterLayer | undefined,
+  layer: TipitakaLayer | undefined,
   page: number,
 ) => {
   const term = q.trim();
   const params = { q: term, layer, page, perPage: TITLE_PER_PAGE };
-  return useRemote<ChapterHit, { total?: number }>(
+  return useRemote<TitleHit, { total?: number }>(
     term ? JSON.stringify(params) : null,
-    () => searchChapters(params),
+    () => searchTitles(params),
   );
 };
 

+ 4 - 4
dashboard-v6/src/features/search/state.ts

@@ -2,7 +2,7 @@
 // 两边共用同一套字段,「在整页打开」只是把它序列化成查询串。
 import type {
   BoldScope,
-  ChapterLayer,
+  TipitakaLayer,
   SearchMode,
 } from "../../api/tipitaka-search";
 
@@ -17,7 +17,7 @@ export const SEARCH_TABS: SearchTab[] = [
 
 export const SEARCH_MODES: SearchMode[] = ["fuzzy", "exact", "definition"];
 
-const CHAPTER_LAYERS: ChapterLayer[] = ["mula", "atthakatha", "tika", "anna"];
+const TIPITAKA_LAYERS: TipitakaLayer[] = ["mula", "atthakatha", "tika", "anna"];
 
 /** 定义标签页的黑体范围:all 是不限 */
 export type DefinitionBold = BoldScope | "all";
@@ -33,7 +33,7 @@ export interface ISearchState {
   /** 全文:页码 */
   page: number;
   /** 标题:层级 */
-  layer?: ChapterLayer;
+  layer?: TipitakaLayer;
   /** 标题:页码 */
   titlePage: number;
   /** 定义:勾选的词形;undefined 表示按默认(输入词那一组的全部词形) */
@@ -105,7 +105,7 @@ export const parseSearchParams = (sp: URLSearchParams): ISearchState => ({
   mode: oneOf(SEARCH_MODES, sp.get("mode")) ?? "fuzzy",
   category: splitList(sp.get("category")),
   page: positive(sp.get("page")),
-  layer: oneOf(CHAPTER_LAYERS, sp.get("layer")),
+  layer: oneOf(TIPITAKA_LAYERS, sp.get("layer")),
   titlePage: positive(sp.get("title_page")),
   forms: sp.has("forms") ? splitList(sp.get("forms")) : undefined,
   bold: oneOf(DEFINITION_BOLDS, sp.get("bold")) ?? "only",

+ 2 - 2
openapi/public/assets/protocol/main.yaml

@@ -877,8 +877,6 @@ paths:
     $ref: ./resources/auto/v3-tipitaka-channels.yaml
   '/v3/tipitaka-chapter-channels/{book}/{para}':
     $ref: ./resources/auto/v3-tipitaka-chapter-channels-book-para.yaml
-  /v3/tipitaka-chapters:
-    $ref: ./resources/auto/v3-tipitaka-chapters.yaml
   '/v3/tipitaka-discussions/{channel}':
     $ref: ./resources/auto/v3-tipitaka-discussions-channel.yaml
   '/v3/tipitaka-page-numbers/{page}':
@@ -893,6 +891,8 @@ paths:
     $ref: ./resources/auto/v3-tipitaka-related-paragraphs-aggregate.yaml
   '/v3/tipitaka-related-paragraphs/aggregate/{book_name}':
     $ref: ./resources/auto/v3-tipitaka-related-paragraphs-aggregate-book-name.yaml
+  /v3/tipitaka-titles:
+    $ref: ./resources/auto/v3-tipitaka-titles.yaml
   /v3/tipitaka-word-paragraphs:
     $ref: ./resources/auto/v3-tipitaka-word-paragraphs.yaml
   /v3/tipitaka-word-paragraphs/aggregate:

+ 1 - 1
openapi/public/assets/protocol/overrides/v2-search-title-index.yaml

@@ -1,5 +1,5 @@
 get:
   deprecated: true
   description: |
-    已被 `GET /v3/tipitaka-chapters` 取代(带坐标、容错匹配、可按书列出全部标题),
+    已被 `GET /v3/tipitaka-titles` 取代(带坐标、容错匹配、可按书列出全部标题),
     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。

+ 1 - 1
openapi/public/assets/protocol/resources/auto/v2-search-title-index.yaml

@@ -5,7 +5,7 @@ get:
     - search-title-index
   operationId: get_api_v2_search_title_index
   description: |
-    已被 `GET /v3/tipitaka-chapters` 取代(带坐标、容错匹配、可按书列出全部标题),
+    已被 `GET /v3/tipitaka-titles` 取代(带坐标、容错匹配、可按书列出全部标题),
     保留仅为 dashboard-v4 兼容,待 v4 下线后删除。
   parameters:
     -

+ 4 - 4
openapi/public/assets/protocol/resources/auto/v3-tipitaka-chapters.yaml → openapi/public/assets/protocol/resources/auto/v3-tipitaka-titles.yaml

@@ -1,9 +1,9 @@
-# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-tipitaka-chapters.yaml
+# 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-tipitaka-titles.yaml
 get:
   summary: 找章节
   tags:
-    - tipitaka-chapters
-  operationId: get_api_v3_tipitaka_chapters
+    - tipitaka-titles
+  operationId: get_api_v3_tipitaka_titles
   description: |-
     两种用法,可以叠加:
     - **按名字找**(给 `q`):巴利名不分大小写、变音符号可有可无(`mahaparinibbana`),可以只写
@@ -15,7 +15,7 @@ get:
     `paragraphs` / `chars` 是这一章的段数与字符数;`parent` / `prev` / `next` 是同一本书里的段号,
     没有为 null;`path` 是从丛书到上一级的路径(不含本章)。
 
-    实现:`V3\TipitakaChapterController@__invoke`
+    实现:`V3\TipitakaTitleController@__invoke`
   security:
     - {  }
     -