Просмотр исходного кода

Merge pull request #2501 from visuddhinanda/development

Development
visuddhinanda 5 дней назад
Родитель
Сommit
7c008b0e26
100 измененных файлов с 21100 добавлено и 830 удалено
  1. 7 1
      CLAUDE.md
  2. 6 7
      api-test/README.md
  3. 76 17
      api-test/cases/02_search.php
  4. 0 44
      api-test/cases/11_tipitaka_chapters.php
  5. 44 0
      api-test/cases/11_tipitaka_titles.php
  6. 24 0
      api-test/cases/20_pali_word_forms.php
  7. 41 0
      api-test/cases/21_tipitaka_word_paragraphs.php
  8. 29 0
      api-test/cases/22_tipitaka_page_numbers.php
  9. 27 0
      api-test/cases/23_pali_word_suggestions.php
  10. 123 18
      api-test/client/.openapi-generator/FILES
  11. 502 0
      api-test/client/lib/Api/NissayaCardsApi.php
  12. 487 0
      api-test/client/lib/Api/PaliWordFormsApi.php
  13. 503 0
      api-test/client/lib/Api/PaliWordSuggestionsApi.php
  14. 158 101
      api-test/client/lib/Api/SearchApi.php
  15. 64 65
      api-test/client/lib/Api/SearchSuggestionsApi.php
  16. 23 23
      api-test/client/lib/Api/StudiosApi.php
  17. 23 23
      api-test/client/lib/Api/TermsApi.php
  18. 517 0
      api-test/client/lib/Api/TipitakaPageNumbersApi.php
  19. 30 30
      api-test/client/lib/Api/TipitakaTitlesApi.php
  20. 857 0
      api-test/client/lib/Api/TipitakaWordParagraphsApi.php
  21. 6 6
      api-test/client/lib/Api/UpgradeApi.php
  22. 409 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200Response.php
  23. 518 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseData.php
  24. 607 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInner.php
  25. 477 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory.php
  26. 443 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom.php
  27. 443 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner.php
  28. 545 0
      api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataTerm.php
  29. 443 0
      api-test/client/lib/Model/GetApiV3PaliWordFormsWord200Response.php
  30. 443 0
      api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInner.php
  31. 477 0
      api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner.php
  32. 409 0
      api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseMeta.php
  33. 443 0
      api-test/client/lib/Model/GetApiV3PaliWordSuggestions200Response.php
  34. 409 0
      api-test/client/lib/Model/GetApiV3PaliWordSuggestions200ResponseMeta.php
  35. 33 33
      api-test/client/lib/Model/GetApiV3Search200Response.php
  36. 975 0
      api-test/client/lib/Model/GetApiV3Search200ResponseDataInner.php
  37. 579 0
      api-test/client/lib/Model/GetApiV3Search200ResponseMeta.php
  38. 449 0
      api-test/client/lib/Model/GetApiV3Search200ResponseMetaFacetsValueInner.php
  39. 3 3
      api-test/client/lib/Model/GetApiV3SearchSearch200Response.php
  40. 443 0
      api-test/client/lib/Model/GetApiV3SearchSuggestions200Response.php
  41. 675 0
      api-test/client/lib/Model/GetApiV3SearchSuggestions200ResponseDataInner.php
  42. 443 0
      api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200Response.php
  43. 770 0
      api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseDataInner.php
  44. 409 0
      api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseMeta.php
  45. 7 7
      api-test/client/lib/Model/GetApiV3TipitakaTitles200Response.php
  46. 10 10
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInner.php
  47. 4 4
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerPathInner.php
  48. 4 4
      api-test/client/lib/Model/GetApiV3TipitakaTitles200ResponseDataInnerTranslationsInner.php
  49. 443 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200Response.php
  50. 715 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.php
  51. 525 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner.php
  52. 443 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200Response.php
  53. 654 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner.php
  54. 477 0
      api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta.php
  55. 409 0
      api-test/client/lib/Model/GetApiV3Upgrade200Response.php
  56. 443 0
      api-test/client/lib/Model/PostApiV3Search200Response.php
  57. 579 0
      api-test/client/lib/Model/PostApiV3Search200ResponseMeta.php
  58. 165 23
      api-test/client/lib/Model/PostApiV3SearchRequest.php
  59. 1 2
      api-test/fixtures.php
  60. 1 10
      api-test/tools/filter-v3.php
  61. 2 0
      api-v13/app/Http/Controllers/Library/AnthologyReadController.php
  62. 37 0
      api-v13/app/Http/Controllers/V3/PaliWordFormController.php
  63. 39 0
      api-v13/app/Http/Controllers/V3/PaliWordSuggestionController.php
  64. 123 0
      api-v13/app/Http/Controllers/V3/SearchController.php
  65. 0 171
      api-v13/app/Http/Controllers/V3/SearchPlusController.php
  66. 0 195
      api-v13/app/Http/Controllers/V3/SearchSuggestController.php
  67. 44 0
      api-v13/app/Http/Controllers/V3/SearchSuggestionController.php
  68. 42 0
      api-v13/app/Http/Controllers/V3/TipitakaPageNumberController.php
  69. 10 7
      api-v13/app/Http/Controllers/V3/TipitakaTitleController.php
  70. 45 0
      api-v13/app/Http/Controllers/V3/TipitakaWordParagraphAggregateController.php
  71. 41 0
      api-v13/app/Http/Controllers/V3/TipitakaWordParagraphController.php
  72. 69 0
      api-v13/app/Http/Requests/V3/AggregateTipitakaWordParagraphRequest.php
  73. 27 0
      api-v13/app/Http/Requests/V3/IndexPaliWordSuggestionRequest.php
  74. 89 0
      api-v13/app/Http/Requests/V3/IndexSearchRequest.php
  75. 50 0
      api-v13/app/Http/Requests/V3/IndexSearchSuggestionRequest.php
  76. 46 0
      api-v13/app/Http/Requests/V3/IndexTipitakaPageNumberRequest.php
  77. 2 2
      api-v13/app/Http/Requests/V3/IndexTipitakaTitleRequest.php
  78. 33 0
      api-v13/app/Http/Requests/V3/IndexTipitakaWordParagraphRequest.php
  79. 3 0
      api-v13/app/Http/Resources/ArticleResource.php
  80. 27 0
      api-v13/app/Http/Resources/V3/PaliWordFormResource.php
  81. 25 0
      api-v13/app/Http/Resources/V3/PaliWordSuggestionResource.php
  82. 38 0
      api-v13/app/Http/Resources/V3/SearchHitResource.php
  83. 30 0
      api-v13/app/Http/Resources/V3/SearchSuggestionResource.php
  84. 49 0
      api-v13/app/Http/Resources/V3/TipitakaPageNumberResource.php
  85. 3 3
      api-v13/app/Http/Resources/V3/TipitakaTitleResource.php
  86. 41 0
      api-v13/app/Http/Resources/V3/TipitakaWordBookResource.php
  87. 45 0
      api-v13/app/Http/Resources/V3/TipitakaWordParagraphResource.php
  88. 22 8
      api-v13/app/Services/OpenSearchService.php
  89. 85 0
      api-v13/app/Services/V3/PaliWordFormService.php
  90. 38 0
      api-v13/app/Services/V3/PaliWordSuggestionService.php
  91. 267 0
      api-v13/app/Services/V3/SearchService.php
  92. 69 0
      api-v13/app/Services/V3/TipitakaBookService.php
  93. 100 0
      api-v13/app/Services/V3/TipitakaPageNumberService.php
  94. 2 2
      api-v13/app/Services/V3/TipitakaTitleService.php
  95. 252 0
      api-v13/app/Services/V3/TipitakaWordParagraphService.php
  96. 4 4
      api-v13/config/mint.php
  97. 3 3
      api-v13/documents/search-recall.md
  98. 24 4
      api-v13/resources/js/search-suggest.js
  99. 1 0
      api-v13/resources/lang/en/site.php
  100. 1 0
      api-v13/resources/lang/zh-Hans/site.php

+ 7 - 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 代写 |
@@ -364,6 +364,12 @@ Resource / FormRequest / 测试同理;URL 只换版本前缀
 | `terms-export`(+`/{uuid}`)+ `terms-import` / `TermExportController` | `channels/{channel}/terms`、`studios/{studio}/terms`(`Accept: xlsx`)+ `channels/{channel}/terms/imports`、`studios/{studio}/terms/imports` / `V3\ChannelTermController`、`V3\StudioTermController` + `V3\ChannelTermImportController`、`V3\StudioTermImportController`(逻辑在 `V3\TermExchangeService`) | 2026-11-17。**导出不设端点**:列表接口带 `Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` 直接返回整表 xlsx(过滤同列表、权限同列表;v2 只要登录、不查权限,且先存 Redis 再凭 uuid 下载)。列 `id / word / tag / meaning / other_meaning / summary / note / quality / content_type / redirect / language / channel_id / etag`。**导入**:multipart 上传 xlsx(不再经附件临时区、不再用 GET 写入;≤5MB、≤5000 行),按**列名**读(v2 导出的表也能用);**部分成功**(出错行跳过,`errors[{row,message}]`),有 id 改那条、word / tag 不能改、带 etag 列时校验(导出后被改过就跳过),无 id 按 word + tag 找、有就改没有就建;「有 id、word 为空就删除」去掉;channel 导入的 language / channel_id 列不看;studio 导入按 `channel_id` 落 channel(须属该 studio 且可写),空的是 studio 通用(要 language,新建要团队 owner / manager);不支持 agent;≤50 条改动立即重建搜索索引,更多的等每周 `opensearch:index-term`。生成器为此支持 `@bodyParam x file`(multipart)。v6 `TermImport` / `TermExport` 已切 |
 | `grammar-guide/{词_语言}` / `GrammarGuideController@show` | (无新端点)`glossaries/grammar` + `terms/{term}`,退回 `terms?word=` | 2026-11-17。语法点悬停说明(v6 `components/dict/GrammarPop.tsx`)。v2 在语法术语系统 channel 里按词查一条、返回 `# 释义\n正文` 的 markdown;v6 改为:启动时已加载的 `/v3/glossaries/grammar` 里按词找 id → `GET /v3/terms/{id}`(新渲染器的 body);表里没有就按词查 `GET /v3/terms?word=&with_body=true`,只认 `_System_Grammar_Term_{界面语言}_`、其次 en 那个 channel 的;都没有显示「暂无…的语法说明」。悬停查询失败不弹全局提示(quiet)。`api/Guide.ts` 已删。顺带修了 `terms?with_body=` 与 `studios/{s}/terms?general=` 收不了查询串 `true`/`false` 的 422 |
 | `nissaya-card/{ending}` / `NissayaCardController@show` | `nissaya-cards/{ending}` / `V3\NissayaCardController`(逻辑在 `V3\NissayaCardService`) | 2026-11-17。缅文 nissaya 词尾卡片(v6 `components/nissaya/NissayaCard`),只读、公开。只给结构化数据:去掉 mustache 渲染的 markdown 分支、写死在后端的表头文字、拼好的 dashboard 链接(前端自己拼);术语一次批量查(v2 逐格位 N+1);词尾说明是新渲染器的 `body` 节点树。字段 `row`→`relations`、`case`→`cases[{case,label}]`、`local_relation`→`relation_label`、`local_ending`(分号拼接)→`local_endings`(数组);查不到的词尾回空卡片(200)。语法术语 channel 没有该语言时回退 en,`lang` 是实际用到的语言。v6 已切;mobile、插件不用 |
+| (无对应 v2 端点;早期 v3)`search`(GET / POST / `{id}`)/ `V3\SearchPlusController` | `search`(不变)/ `V3\SearchController`(逻辑在 `V3\SearchService`) | 2026-11-19,按现行 v3 规范重写(v2 的 `SearchController` 是 PostgreSQL 全文检索,另一套,不受影响)。控制器改名 `SearchPlusController`→`SearchController`;入参走 `IndexSearchRequest`:`q` 必填(不再 `match_all` 全索引),`search_mode` / `resource_type`(`tipitaka`/`original_text`/`term`)/ `granularity`(`book`/`chapter`/`session`/`paragraph`)按索引真实值校验,`page_size`→`per_page`(≤100),`page × per_page` > 10000 时 422(原来 OpenSearch 报错变 500)。响应从 OpenSearch 原始结构 `{success, data:{took, hits, aggregations}, query_info}` 改成 `{data:[hit], meta:{current_page, per_page, total, total_relation, last_page}}`,hit 是扁平字段(`related_id`、`title`、`content`、`highlight`、`bold[]`、`score`…),不再透出 `_source`;分面聚合改为 `facets=true` 才算(`meta.facets`)。错误走 Problem Details:搜索集群连不上 / 超时 / 过载 → 503 `search-unavailable`(原来 catch 后把原始报错 + 500 吐给客户端、且不写日志);`{id}` 只有文档不存在才 404(原来任何异常都 404)。共享的 `OpenSearchService::search()` 加了 `aggregations` 开关(默认 true,Library 与 AITermService 不变),顺带修 `channel` 过滤(text 字段用 term 永远不中→`match_phrase`)与数组 `related_id`(term→terms)。POST 保留(用户定)。wikipali-plugins(`phrase` / `find`)、agent-poc 召回评测脚本已切;v6、mobile 不调用。`search-suggest` 未迁 |
+| (无对应 v2 端点;早期 v3)`search-suggest` / `V3\SearchSuggestController` | `search-suggestions` / `V3\SearchSuggestionController`(逻辑在 `V3\SearchService::suggest`) | 2026-11-19。搜索框前缀补全(OpenSearch completion)。路径复数化,旧路径删除(404);`{success, data:{query, suggestions, total}}`→`{data:[{text, source, score, doc_id, resource_type, language, granularity, category}], meta:{total}}`;空 q 从 400 改 422;`fields` 按真实字段校验(`title_pali`/`title_zh`/`content_pali`/`content_zh`,旧注释写的 title/content/page_refs 一传就 400);`limit` 从「每个字段各取」(实际最多 4 倍)改成总条数,并按词去重;`language` 去掉(completion 忽略 query,从未生效,用户定);completion 只取四个元数据字段,不再逐条带回整篇 `_source`;搜索集群不可用 503。Library 搜索框(`resources/js/search-suggest.js`)已切,顺带修了候选文本未转义直接进 `innerHTML`。v4 的 `ChatInput` 还指着旧路径(线上不可达,不改) |
+| `case/{word}` / `CaseController@show` | `pali-word-forms/{word}` / `V3\PaliWordFormController`(逻辑在 `V3\PaliWordFormService`) | 2026-11-19。词形展开:词 → 可能的词根 → 每个词根在三藏里出现过的词形与次数、黑体次数。**改名**:v2 的 case 不是语法格,是词形展开。`rows[].word`→`data[].base`、`rows[].case`→`data[].forms`,去掉每条里多余的 `"0":"ending"`;没有任何词形出现过的词根不列(v2 给一个空 case 行);词不区分大小写;候选词形一次 `whereIn` 查 `word_indices`(v2 逐个查,一个词上百次)。词根推导仍用共享的 `CaseMan::WordToBase(…, verify: false)`(纯字符串运算)。v6(字典页 `CaseList`、搜索「定义」标签页)、wikipali-plugins(`forms` / `count` / `search --lemma` / `find`)已切;mobile 不用 |
+| `search-pali-wbw`(GET / POST)+ `search-pali-wbw-books` / `SearchPaliWbwController@index` + `@book_list` | `tipitaka-word-paragraphs`(+`/aggregate`)/ `V3\TipitakaWordParagraphController` + `V3\TipitakaWordParagraphAggregateController`(逻辑在 `V3\TipitakaWordParagraphService`) | 2026-11-19。按词形找段落(逐词表 `wbw_templates`,连音已拆开,精确匹配)+ 按书统计。**改名**,与 `tipitaka-related-paragraphs`(+`/aggregate`)同构。参数 `key`→`words`(≤200 个,空词形 422),`bold=on|off`→`bold=only|exclude`,`book`→`book_id`(逗号多选),`limit/offset`→`page/per_page`(≤100);`view`、`tags` 去掉(插件 `--tags` 改为先调 `/aggregate` 按书的 tag 筛 book_id)。字段 `paragraph`→`para`、`rank`→`score`(另有 `hits`)、`paliTitle`→`title`、`highlight`→`text`(整段正文,只含 `<b>` 黑体与 `<mark>` 命中词,其余已转义)、`ref`→`refs`(加 `volume`);不再给指向旧版 library 的 `link`(插件按坐标拼)。同分按经文顺序(v2 不定序)。段落、页码整页批量取(v2 每行 3~4 次查询)。`/aggregate` 同时给 `paragraphs` 与 `occurrences`(v2 只有词次 `count`),另给 `layer`、`tags`(字符串数组);`pcdBookId`→`book_id`。v6 搜索「定义」标签页、wikipali-plugins(`search` / `find` / `dist` / `ref`,CLI 输出字段名不变)已切;v6 的 `components/tipitaka/BookTreeWithTags.tsx` 仍调 v2,但它没有任何引用(死代码,用户定保留不动);mobile 不用 |
+| `search-page-number/{number}` / `SearchPageNumberController@show`(另含 v2 `search?view=page` 的「卷.页」查法) | `tipitaka-page-numbers/{page}` / `V3\TipitakaPageNumberController`(逻辑在 `V3\TipitakaPageNumberService`) | 2026-11-19。按印本页码找段落。**改名**。新增过滤 `edition`(PTS / My / VRI / Thai / Other / CS,与 `tipitaka-word-paragraphs` 的 `refs.type` 同名)与 `volume`(v2 只能查页码、各版本混在一起);v2 的 `type=para`(逐词表里 CS 版印的段落号 `para{n}`)→`edition=CS`,给了 `volume` 时不返回。字段:单字母 `type`→`edition`,`paragraph`→`para`,`pcd_book_id`→`book_id`,卷号 0(未知)→`volume: null`;新增 `book_title`、`book_para`(书名所在段,CS 段落号按书编号)、`edition_title`(静态书名表 `Http\Api\BookTitle` 里该版本的书名,v6 印本页阅读页按「版本_版本书名_卷_页」定位)、`layer`、`tags`(v6 按它做目录树过滤)。不分页(一个页码最多约一千处),按版本、书、卷、段排序;书名与层级批量取(`V3\TipitakaBookService`,逐词检索的 `/aggregate` 也改用它)。v6 搜索「页码」标签页已切;只有 v4 `PageNumberList` 用 v2;mobile、插件不用 |
+| `pali-word-index?view=key` / `WordIndexController@index` | `pali-word-suggestions` / `V3\PaliWordSuggestionController`(逻辑在 `V3\PaliWordSuggestionService`) | 2026-11-19。搜索框的巴利词补全(`word_indices`)。**改名**:v2 名字是表名,v3 按用途叫 suggestions,与 `search-suggestions`(OpenSearch completion,补标题与正文)并列。`key`→`q`,`rows`→`data`,`count`→`meta.total`,新增 `limit`(默认 10,≤50);只回 `word`/`count`/`bold`(v2 整行吐出);排序从「词长、去变音形」改成「与输入相同的在前,其余按出现次数降序」(v2 下 vit 补出 vītā/1、vitā/2 这类罕见短词形);`%`、`_` 按字面匹配;不区分大小写。v6 搜索框(`features/search/SearchInput`,补全最后一个词,回车搜原文、选候选才替换)已切;只有 v4 `FullSearchInput` 用 v2;mobile、插件不用 |
 
 **注意**:`tipitaka-reading` **不是** v2 `paragraph-content` / `chapter-content` 的替代品。
 那两个 v2 端点支持多 channel(`channels=a,b,c`)与 edit 模式、返回 sentenceIds 供编辑器用;

+ 6 - 7
api-test/README.md

@@ -169,7 +169,7 @@ bash api-test/tools/regen.sh
 - **新增端点** → 在 `cases/` 加对应 `test()`(参照现有文件按领域放)。
 - **参数变了**(新增 required、改名、枚举增删)→ 改对应用例的入参。
 - **响应字段变了**(Resource 的 `@return` 改了形状)→ 改对应断言。
-- **种子数据失效** → `fixtures.php` 里的 `channel` / `target_id` / `search_doc_id` 换新值。
+- **种子数据失效** → `fixtures.php` 里的 `channel` / `target_id` 换新值。
 
 ### 4. 跑全量验证
 
@@ -187,20 +187,19 @@ php run.php --username=<username> --password=<password> --server=staging
 
 | 端点                     | spec 说                                          | 实际                                                                        | 处理                                                                                   |
 | ------------------------ | ------------------------------------------------ | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
-| `GET/POST /v3/search`    | 200 `{data:数组, meta}` + 非法 `search_mode` 422 | 200 `{success, data:{took,hits}}`;`search_mode` 不校验                     | `filter-v3.php` 把 200 schema 修为 `{success,data:对象}`;用例只断言状态码 + `data` 键 |
-| `GET /v3/search-suggest` | 200 `{data:数组, meta}`;空 q 422                | 200 `{success, data:{query,suggestions}}`;空 q 400 `{success:false,error}` | 同上修 schema;空 q 用例按实际 400 断言                                                |
 | `GET /v3/upgrade`        | 200 `{data:数组, meta}`                          | 200 `{data:{status:"ok"}}`                                                  | 修 schema 为 `{data:对象}`                                                             |
 
-根因是这三个控制器还没迁到 v3 的 Resource 信封(`{data}` 原生形状、错误体 RFC 9457
+根因是这个控制器还没迁到 v3 的 Resource 信封(`{data}` 原生形状、错误体 RFC 9457
 Problem Details、成败只看状态码)。正确的长期修法在 api-v13 侧,这里只让测试客户端能用、
-把漂移显式记录。`filter-v3.php` 里的 `applyDriftPatches()` 就是这三处补丁,改对齐后可删。
+把漂移显式记录。`filter-v3.php` 里的 `applyDriftPatches()` 就是这处补丁,改对齐后可删。(`/v3/search`、`/v3/search-suggestions` 已于 2026-11-19 对齐,补丁已删。)
 
 ## 环境注意
 
 - **pspell / xdebug 启动警告**:本机 PHP CLI 的 pspell 扩展与 PHP 版本不匹配,每次 `php`
   都会在 stderr 打警告,与测试无关,可忽略。
-- **staging 的 OpenSearch**:`/v3/search`、`/v3/search-suggest` 在 staging 会 500
-  (索引 mapping 与代码不一致:`resource_type` 缺 fielddata、`content.suggest.pali` 没映射)。
+- **staging 的 OpenSearch**:`/v3/search?facets=true`、`/v3/search-suggestions` 在 staging 会 500
+  (索引 mapping 与代码不一致:`resource_type` 是 text 不能聚合、`content.suggest.pali` 不是 completion)。
+  `/v3/search` 默认不再算聚合,不带 facets 时不受影响。
   这是 staging 环境问题,本地跑这几条是绿的。
 - **`registered_email` 种子**:`email-certifications` 的「已注册邮箱 → 422」用例需要一个
   真实存在的账号邮箱,从环境变量 `API_TEST_REGISTERED_EMAIL` 读,没给就 SKIP。它只走

+ 76 - 17
api-test/cases/02_search.php

@@ -1,28 +1,75 @@
 <?php
 
 use \WikipaliApi\Api\SearchApi;
-use \WikipaliApi\Api\SearchSuggestApi;
+use \WikipaliApi\Api\SearchSuggestionsApi;
 use \WikipaliApi\Model\PostApiV3SearchRequest;
 
-test('GET /v3/search?q=dukkha → 200', function () {
-    $res = request(fn () => api(SearchApi::class)->getApiV3SearchWithHttpInfo(fixtures()['search_q']));
+/** 一条命中必须有的字段(v3 归一化后的形状,不再透出 OpenSearch 的 _source) */
+const SEARCH_HIT_KEYS = ['id', 'resource_type', 'resource_id', 'granularity', 'language', 'related_id',
+    'score', 'title', 'content', 'highlight', 'bold', 'path', 'category', 'tags', 'updated_at'];
+
+function assert_search_page(array $res, string $what): void
+{
+    assert_has_key('data', $res['body'], $what);
+    assert_has_key('meta', $res['body'], $what);
+    foreach (['current_page', 'per_page', 'total', 'total_relation', 'last_page'] as $key) {
+        assert_has_key($key, $res['body']['meta'], "{$what} meta");
+    }
+    if (! is_array($res['body']['data']) || $res['body']['data'] === []) {
+        fail("{$what}:data 应是非空列表");
+    }
+    foreach (SEARCH_HIT_KEYS as $key) {
+        assert_has_key($key, $res['body']['data'][0], "{$what} data[0]");
+    }
+    if (array_key_exists('_source', $res['body']['data'][0])) {
+        fail("{$what}:不应再透出 _source");
+    }
+}
+
+test('GET /v3/search?q=dukkha → 200 {data, meta}', function () {
+    $res = request(fn () => api(SearchApi::class)->getApiV3SearchWithHttpInfo(
+        fixtures()['search_q'], 'fuzzy', 'tipitaka', null, 'paragraph', null, null, null, null, null, null, null, false, 1, 5));
     assert_status(200, $res, 'search GET');
-    // spec 说 data 是数组,实际是 {success,data:{took,hits}}(漂移,见 README)
-    assert_has_key('data', $res['body'], 'search GET');
+    assert_search_page($res, 'search GET');
+    assert_eq(5, $res['body']['meta']['per_page'], 'search GET per_page');
+    if (array_key_exists('facets', $res['body']['meta'])) {
+        fail('search GET:没要 facets 就不应返回');
+    }
+});
+
+test('GET /v3/search?facets=true → meta.facets 分面计数', function () {
+    $res = raw('GET', '/v3/search', ['q' => fixtures()['search_q'], 'per_page' => 1, 'facets' => 'true']);
+    assert_status(200, $res, 'search facets');
+    assert_has_key('facets', $res['body']['meta'], 'search facets');
+    assert_has_key('resource_type', $res['body']['meta']['facets'], 'search facets');
 });
 
 test('POST /v3/search → 200(与 GET 等价,参数在 body)', function () {
     $body = new PostApiV3SearchRequest();
     $body->setQ(fixtures()['search_q']);
+    $body->setPerPage(3);
     $res = request(fn () => api(SearchApi::class)->postApiV3SearchWithHttpInfo($body));
     assert_status(200, $res, 'search POST');
-    assert_has_key('data', $res['body'], 'search POST');
+    assert_search_page($res, 'search POST');
+});
+
+test('GET /v3/search(缺 q / 非法模式 / 翻页过深)→ 422', function () {
+    assert_field_error('q', raw('GET', '/v3/search'), 'search 缺 q');
+    assert_field_error('search_mode', raw('GET', '/v3/search', ['q' => 'x', 'search_mode' => 'bogus']), 'search 非法模式');
+    assert_field_error('page', raw('GET', '/v3/search', ['q' => 'x', 'per_page' => 100, 'page' => 101]), 'search 翻页过深');
 });
 
-test('GET /v3/search/{id} → 200(真实文档 id)', function () {
-    $res = request(fn () => api(SearchApi::class)->getApiV3SearchSearchWithHttpInfo(fixtures()['search_doc_id']));
+test('GET /v3/search/{id} → 200(取检索结果里的第一条)', function () {
+    // 文档 id 从检索结果里拿,不依赖各环境的种子数据
+    $hits = raw('GET', '/v3/search', ['q' => fixtures()['search_q'], 'per_page' => 1]);
+    assert_status(200, $hits, 'search show 前置检索');
+    $id = $hits['body']['data'][0]['id'] ?? null;
+    if (! is_string($id)) {
+        fail('search show:检索结果为空,拿不到文档 id');
+    }
+    $res = request(fn () => api(SearchApi::class)->getApiV3SearchSearchWithHttpInfo($id));
     assert_status(200, $res, 'search show');
-    assert_has_key('data', $res['body'], 'search show');
+    assert_eq($id, $res['body']['data']['id'] ?? null, 'search show id');
 });
 
 test('GET /v3/search/{id} → 404(不存在的文档)', function () {
@@ -31,14 +78,26 @@ test('GET /v3/search/{id} → 404(不存在的文档)', function () {
     assert_problem($res, 'search show 404');
 });
 
-test('GET /v3/search-suggest?q=dukkha → 200', function () {
-    $res = request(fn () => api(SearchSuggestApi::class)->getApiV3SearchSuggestWithHttpInfo(fixtures()['search_q']));
-    assert_status(200, $res, 'search-suggest');
-    assert_has_key('data', $res['body'], 'search-suggest');
+test('GET /v3/search-suggestions?q=dukkha → 200 {data, meta}', function () {
+    $res = request(fn () => api(SearchSuggestionsApi::class)->getApiV3SearchSuggestionsWithHttpInfo(fixtures()['search_q'], null, 5));
+    assert_status(200, $res, 'search-suggestions');
+    assert_has_key('data', $res['body'], 'search-suggestions');
+    assert_has_key('total', $res['body']['meta'] ?? null, 'search-suggestions meta');
+    if (count($res['body']['data']) > 5) {
+        fail('search-suggestions:limit=5 却返回了 '.count($res['body']['data']).' 条');
+    }
+    $texts = array_map(fn ($s) => mb_strtolower($s['text']), $res['body']['data']);
+    if (count($texts) !== count(array_unique($texts))) {
+        fail('search-suggestions:同一个词出现了不止一次');
+    }
+    foreach ($res['body']['data'] as $s) {
+        foreach (['text', 'source', 'score', 'doc_id', 'resource_type', 'language', 'granularity', 'category'] as $key) {
+            assert_has_key($key, $s, 'search-suggestions 条目');
+        }
+    }
 });
 
-test('GET /v3/search-suggest?q= → 400(空查询)', function () {
-    // 描述里写明「q 为空返回 400」;spec 只登记了 422,这里按实际 400 断言。
-    $res = raw('GET', '/v3/search-suggest', ['q' => '']);
-    assert_status(400, $res, 'search-suggest 空 q');
+test('GET /v3/search-suggestions(缺 q / 未知字段)→ 422', function () {
+    assert_field_error('q', raw('GET', '/v3/search-suggestions', ['q' => '']), 'search-suggestions 空 q');
+    assert_field_error('fields', raw('GET', '/v3/search-suggestions', ['q' => 'd', 'fields' => 'title']), 'search-suggestions 未知字段');
 });

+ 0 - 44
api-test/cases/11_tipitaka_chapters.php

@@ -1,44 +0,0 @@
-<?php
-
-use \WikipaliApi\Api\TipitakaChaptersApi;
-
-/*
- * 章节标题:GET /v3/tipitaka-chapters
- *
- * 只读、无写操作。用长部《大般涅槃经》(book 94 para 287)——CST 三藏的坐标在各服务器上相同。
- * 容错打分的各档、译名可见性、layer 过滤由 api-v13 的 TipitakaChapterV3Test 覆盖。
- */
-
-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');
-    $top = $res['body']['data'][0] ?? null;
-    if (! $top) {
-        fail('tipitaka-chapters:拼错的经名应能找到');
-    }
-    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 行');
-    }
-});
-
-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');
-    $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ā)');
-    }
-});
-
-test('GET /v3/tipitaka-chapters(q 与 book 都不给)→ 422', function () {
-    $res = raw('GET', '/v3/tipitaka-chapters');
-    assert_status(422, $res, '无条件');
-});

+ 44 - 0
api-test/cases/11_tipitaka_titles.php

@@ -0,0 +1,44 @@
+<?php
+
+use \WikipaliApi\Api\TipitakaTitlesApi;
+
+/*
+ * 章节标题:GET /v3/tipitaka-titles
+ *
+ * 只读、无写操作。用长部《大般涅槃经》(book 94 para 287)——CST 三藏的坐标在各服务器上相同。
+ * 容错打分的各档、译名可见性、layer 过滤由 api-v13 的 TipitakaTitleV3Test 覆盖。
+ */
+
+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-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-titles 行');
+    }
+});
+
+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-titles:应包含小节 94:585(Tathāgatapacchimavācā)');
+    }
+});
+
+test('GET /v3/tipitaka-titles(q 与 book 都不给)→ 422', function () {
+    $res = raw('GET', '/v3/tipitaka-titles');
+    assert_status(422, $res, '无条件');
+});

+ 24 - 0
api-test/cases/20_pali_word_forms.php

@@ -0,0 +1,24 @@
+<?php
+
+/*
+ * 词形展开:GET /v3/pali-word-forms/{word}(取代 v2 case/{word})。只读、公开。
+ * 各服务器的词频不同,只核对形状;N+1、大小写、排序由 api-v13 的 PaliWordFormV3Test 覆盖。
+ */
+
+test('GET /v3/pali-word-forms/{word} → 200,第一组是输入的词本身', function () {
+    $res = raw('GET', '/v3/pali-word-forms/'.rawurlencode('dhamma'));
+    assert_status(200, $res, 'word forms');
+    assert_has_key('total', $res['body']['meta'], 'meta');
+    $first = $res['body']['data'][0] ?? null;
+    assert_eq(true, $first !== null, '常见词至少有一组');
+    assert_eq('dhamma', $first['base'], '第一组是输入的词');
+    assert_eq(['word', 'count', 'bold'], array_keys($first['forms'][0]), '词形字段');
+});
+
+test('GET /v3/pali-word-forms/{不存在的词} → 200 空列表;过长 → 404', function () {
+    $res = raw('GET', '/v3/pali-word-forms/qqqzzzxx');
+    assert_status(200, $res, '空列表');
+    assert_eq([], $res['body']['data'], '没有词形');
+    $long = raw('GET', '/v3/pali-word-forms/'.str_repeat('a', 65));
+    assert_status(404, $long, '路径约束');
+});

+ 41 - 0
api-test/cases/21_tipitaka_word_paragraphs.php

@@ -0,0 +1,41 @@
+<?php
+
+/*
+ * 按词形找段落:GET /v3/tipitaka-word-paragraphs (+ /aggregate)(取代 v2 search-pali-wbw / -books)。只读、公开。
+ * 各服务器数据不同,只核对形状与几条不变量;高亮转义、N+1、黑体过滤由 api-v13 的 TipitakaWordParagraphV3Test 覆盖。
+ */
+
+const WORD_FORMS = 'dhammo,dhammaṃ,dhammassa';
+
+test('GET /v3/tipitaka-word-paragraphs → 200,分页、字段完整', function () {
+    $res = raw('GET', '/v3/tipitaka-word-paragraphs', ['words' => WORD_FORMS, 'per_page' => 3]);
+    assert_status(200, $res, 'word paragraphs');
+    foreach (['current_page', 'per_page', 'total', 'last_page'] as $key) {
+        assert_has_key($key, $res['body']['meta'], 'meta');
+    }
+    $row = $res['body']['data'][0] ?? null;
+    assert_eq(true, $row !== null, '常见词至少命中一段');
+    assert_eq(['id', 'book', 'para', 'score', 'hits', 'title', 'level', 'path', 'text', 'refs'], array_keys($row), '段落字段');
+    assert_eq("{$row['book']}-{$row['para']}", $row['id'], 'id 是 book-para');
+    assert_eq('WP', end($row['refs'])['type'], '最后一条 ref 是 WP 段落号');
+});
+
+test('GET /v3/tipitaka-word-paragraphs/aggregate → 每本书的段落数之和等于列表总数', function () {
+    $agg = raw('GET', '/v3/tipitaka-word-paragraphs/aggregate', ['words' => WORD_FORMS, 'bold' => 'only']);
+    assert_status(200, $agg, 'aggregate');
+    $list = raw('GET', '/v3/tipitaka-word-paragraphs', ['words' => WORD_FORMS, 'bold' => 'only', 'per_page' => 1]);
+    assert_eq($list['body']['meta']['total'], $agg['body']['meta']['paragraphs'], '段落总数一致');
+    $book = $agg['body']['data'][0] ?? null;
+    if ($book) {
+        assert_eq(['book_id', 'book', 'para', 'title', 'layer', 'tags', 'paragraphs', 'occurrences'], array_keys($book), '书字段');
+        $one = raw('GET', '/v3/tipitaka-word-paragraphs', ['words' => WORD_FORMS, 'bold' => 'only', 'book_id' => $book['book_id'], 'per_page' => 1]);
+        assert_eq($book['paragraphs'], $one['body']['meta']['total'], '按 book_id 过滤后的总数等于该书的段落数');
+    }
+});
+
+test('GET /v3/tipitaka-word-paragraphs 缺 words / 空词形 / bold 不对 → 422', function () {
+    assert_status(422, raw('GET', '/v3/tipitaka-word-paragraphs'), '缺 words');
+    assert_status(422, raw('GET', '/v3/tipitaka-word-paragraphs', ['words' => ',,']), '空词形');
+    assert_status(422, raw('GET', '/v3/tipitaka-word-paragraphs', ['words' => 'x', 'bold' => 'on']), 'bold=on 是 v2 写法');
+    assert_status(422, raw('GET', '/v3/tipitaka-word-paragraphs/aggregate'), 'aggregate 缺 words');
+});

+ 29 - 0
api-test/cases/22_tipitaka_page_numbers.php

@@ -0,0 +1,29 @@
+<?php
+
+/*
+ * 按印本页码找段落:GET /v3/tipitaka-page-numbers/{page}(取代 v2 search-page-number)。只读、公开。
+ * 各服务器数据不同,只核对形状与过滤的不变量;N+1、排序、卷号 0 由 api-v13 的 TipitakaPageNumberV3Test 覆盖。
+ */
+
+test('GET /v3/tipitaka-page-numbers/{page} → 200,字段完整,meta.total 等于条数', function () {
+    $res = raw('GET', '/v3/tipitaka-page-numbers/100');
+    assert_status(200, $res, 'page numbers');
+    assert_eq(count($res['body']['data']), $res['body']['meta']['total'], 'total 等于条数(不分页)');
+    $row = $res['body']['data'][0] ?? null;
+    assert_eq(true, $row !== null, '第 100 页至少有一处');
+    assert_eq(['edition', 'volume', 'page', 'book', 'para', 'book_id', 'book_title', 'book_para', 'edition_title', 'layer', 'tags'], array_keys($row), '字段');
+});
+
+test('GET /v3/tipitaka-page-numbers/{page}?edition=&volume= → 只要这个版本这一卷', function () {
+    $res = raw('GET', '/v3/tipitaka-page-numbers/100', ['edition' => 'PTS', 'volume' => 2]);
+    assert_status(200, $res, 'filtered');
+    foreach ($res['body']['data'] as $row) {
+        assert_eq(['PTS', 2], [$row['edition'], $row['volume']], '过滤生效');
+    }
+});
+
+test('GET /v3/tipitaka-page-numbers 版本不对 / 卷号 0 → 422;页码不是数字 → 404', function () {
+    assert_status(422, raw('GET', '/v3/tipitaka-page-numbers/100', ['edition' => 'P']), 'edition=P 是 v2 的单字母');
+    assert_status(422, raw('GET', '/v3/tipitaka-page-numbers/100', ['volume' => 0]), 'volume=0');
+    assert_status(404, raw('GET', '/v3/tipitaka-page-numbers/abc'), '路径约束');
+});

+ 27 - 0
api-test/cases/23_pali_word_suggestions.php

@@ -0,0 +1,27 @@
+<?php
+
+/*
+ * 巴利词补全:GET /v3/pali-word-suggestions?q=(取代 v2 pali-word-index?view=key)。只读、公开。
+ * 各服务器的词频不同,只核对形状与排序规则;通配符、去变音匹配由 api-v13 的 PaliWordSuggestionV3Test 覆盖。
+ */
+
+test('GET /v3/pali-word-suggestions → 200,都以前缀开头,与输入相同的在前、其余按次数降序', function () {
+    $res = raw('GET', '/v3/pali-word-suggestions?q=vitakk&limit=5');
+    assert_status(200, $res, 'suggestions');
+    $data = $res['body']['data'];
+    assert_eq(count($data), $res['body']['meta']['total'], 'meta.total 等于条数');
+    assert_eq(true, count($data) > 0 && count($data) <= 5, 'limit 生效');
+    assert_eq(['word', 'count', 'bold'], array_keys($data[0]), '字段');
+    foreach ($data as $w) {
+        assert_eq(true, str_starts_with($w['word'], 'vitakk'), "{$w['word']} 以前缀开头");
+    }
+    $counts = array_column($data, 'count');
+    $sorted = $counts;
+    rsort($sorted);
+    assert_eq($sorted, $counts, '按出现次数降序');
+});
+
+test('GET /v3/pali-word-suggestions 缺 q / limit 越界 → 422', function () {
+    assert_status(422, raw('GET', '/v3/pali-word-suggestions'), '缺 q');
+    assert_status(422, raw('GET', '/v3/pali-word-suggestions?q=a&limit=51'), 'limit 越界');
+});

+ 123 - 18
api-test/client/.openapi-generator/FILES

@@ -21,22 +21,27 @@ docs/Api/GroupsApi.md
 docs/Api/HeartbeatApi.md
 docs/Api/InvitesApi.md
 docs/Api/MeApi.md
+docs/Api/NissayaCardsApi.md
+docs/Api/PaliWordFormsApi.md
+docs/Api/PaliWordSuggestionsApi.md
 docs/Api/PasswordResetsApi.md
 docs/Api/ProgressApi.md
 docs/Api/ReactionsApi.md
 docs/Api/ReadingTimeApi.md
 docs/Api/SearchApi.md
-docs/Api/SearchSuggestApi.md
+docs/Api/SearchSuggestionsApi.md
 docs/Api/SessionsApi.md
 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
 docs/Model/GetApiV3AdminAgentFeedback200Response.md
@@ -118,6 +123,19 @@ docs/Model/GetApiV3MeGroups200Response.md
 docs/Model/GetApiV3MeGroups200ResponseDataInner.md
 docs/Model/GetApiV3MeReactions200Response.md
 docs/Model/GetApiV3MeReactions200ResponseDataInner.md
+docs/Model/GetApiV3NissayaCardsEnding200Response.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseData.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInner.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner.md
+docs/Model/GetApiV3NissayaCardsEnding200ResponseDataTerm.md
+docs/Model/GetApiV3PaliWordFormsWord200Response.md
+docs/Model/GetApiV3PaliWordFormsWord200ResponseDataInner.md
+docs/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner.md
+docs/Model/GetApiV3PaliWordFormsWord200ResponseMeta.md
+docs/Model/GetApiV3PaliWordSuggestions200Response.md
+docs/Model/GetApiV3PaliWordSuggestions200ResponseMeta.md
 docs/Model/GetApiV3PasswordResetsToken200Response.md
 docs/Model/GetApiV3PasswordResetsToken200ResponseData.md
 docs/Model/GetApiV3Progress200Response.md
@@ -125,17 +143,21 @@ docs/Model/GetApiV3Progress200ResponseDataInner.md
 docs/Model/GetApiV3ReactionsTally200Response.md
 docs/Model/GetApiV3ReactionsTally200ResponseDataInner.md
 docs/Model/GetApiV3Search200Response.md
+docs/Model/GetApiV3Search200ResponseDataInner.md
+docs/Model/GetApiV3Search200ResponseMeta.md
+docs/Model/GetApiV3Search200ResponseMetaFacetsValueInner.md
 docs/Model/GetApiV3SearchSearch200Response.md
+docs/Model/GetApiV3SearchSuggestions200Response.md
+docs/Model/GetApiV3SearchSuggestions200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaChannels200Response.md
 docs/Model/GetApiV3TipitakaChannels200ResponseDataInner.md
 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
 docs/Model/GetApiV3TipitakaReadingChannel200Response.md
 docs/Model/GetApiV3TipitakaReadingChannel200ResponseDataInner.md
 docs/Model/GetApiV3TipitakaReadingChannel200ResponseMeta.md
@@ -147,6 +169,17 @@ 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
+docs/Model/GetApiV3TipitakaWordParagraphsAggregate200Response.md
+docs/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner.md
+docs/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta.md
+docs/Model/GetApiV3Upgrade200Response.md
 docs/Model/MarkupElement.md
 docs/Model/MarkupNode.md
 docs/Model/MarkupTemplate.md
@@ -204,6 +237,8 @@ docs/Model/PostApiV3MeReadingTime200Response.md
 docs/Model/PostApiV3MeReadingTime200ResponseData.md
 docs/Model/PostApiV3MeReadingTimeRequest.md
 docs/Model/PostApiV3PasswordResetsRequest.md
+docs/Model/PostApiV3Search200Response.md
+docs/Model/PostApiV3Search200ResponseMeta.md
 docs/Model/PostApiV3SearchRequest.md
 docs/Model/PostApiV3Sessions200Response.md
 docs/Model/PostApiV3Sessions200ResponseData.md
@@ -232,22 +267,27 @@ lib/Api/GroupsApi.php
 lib/Api/HeartbeatApi.php
 lib/Api/InvitesApi.php
 lib/Api/MeApi.php
+lib/Api/NissayaCardsApi.php
+lib/Api/PaliWordFormsApi.php
+lib/Api/PaliWordSuggestionsApi.php
 lib/Api/PasswordResetsApi.php
 lib/Api/ProgressApi.php
 lib/Api/ReactionsApi.php
 lib/Api/ReadingTimeApi.php
 lib/Api/SearchApi.php
-lib/Api/SearchSuggestApi.php
+lib/Api/SearchSuggestionsApi.php
 lib/Api/SessionsApi.php
 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
 lib/ApiException.php
@@ -333,6 +373,19 @@ lib/Model/GetApiV3MeGroups200Response.php
 lib/Model/GetApiV3MeGroups200ResponseDataInner.php
 lib/Model/GetApiV3MeReactions200Response.php
 lib/Model/GetApiV3MeReactions200ResponseDataInner.php
+lib/Model/GetApiV3NissayaCardsEnding200Response.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseData.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInner.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner.php
+lib/Model/GetApiV3NissayaCardsEnding200ResponseDataTerm.php
+lib/Model/GetApiV3PaliWordFormsWord200Response.php
+lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInner.php
+lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner.php
+lib/Model/GetApiV3PaliWordFormsWord200ResponseMeta.php
+lib/Model/GetApiV3PaliWordSuggestions200Response.php
+lib/Model/GetApiV3PaliWordSuggestions200ResponseMeta.php
 lib/Model/GetApiV3PasswordResetsToken200Response.php
 lib/Model/GetApiV3PasswordResetsToken200ResponseData.php
 lib/Model/GetApiV3Progress200Response.php
@@ -340,17 +393,21 @@ lib/Model/GetApiV3Progress200ResponseDataInner.php
 lib/Model/GetApiV3ReactionsTally200Response.php
 lib/Model/GetApiV3ReactionsTally200ResponseDataInner.php
 lib/Model/GetApiV3Search200Response.php
+lib/Model/GetApiV3Search200ResponseDataInner.php
+lib/Model/GetApiV3Search200ResponseMeta.php
+lib/Model/GetApiV3Search200ResponseMetaFacetsValueInner.php
 lib/Model/GetApiV3SearchSearch200Response.php
+lib/Model/GetApiV3SearchSuggestions200Response.php
+lib/Model/GetApiV3SearchSuggestions200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaChannels200Response.php
 lib/Model/GetApiV3TipitakaChannels200ResponseDataInner.php
 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
 lib/Model/GetApiV3TipitakaReadingChannel200Response.php
 lib/Model/GetApiV3TipitakaReadingChannel200ResponseDataInner.php
 lib/Model/GetApiV3TipitakaReadingChannel200ResponseMeta.php
@@ -362,6 +419,17 @@ 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
+lib/Model/GetApiV3TipitakaWordParagraphsAggregate200Response.php
+lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner.php
+lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta.php
+lib/Model/GetApiV3Upgrade200Response.php
 lib/Model/MarkupElement.php
 lib/Model/MarkupNode.php
 lib/Model/MarkupTemplate.php
@@ -420,6 +488,8 @@ lib/Model/PostApiV3MeReadingTime200Response.php
 lib/Model/PostApiV3MeReadingTime200ResponseData.php
 lib/Model/PostApiV3MeReadingTimeRequest.php
 lib/Model/PostApiV3PasswordResetsRequest.php
+lib/Model/PostApiV3Search200Response.php
+lib/Model/PostApiV3Search200ResponseMeta.php
 lib/Model/PostApiV3SearchRequest.php
 lib/Model/PostApiV3Sessions200Response.php
 lib/Model/PostApiV3Sessions200ResponseData.php
@@ -449,22 +519,27 @@ test/Api/GroupsApiTest.php
 test/Api/HeartbeatApiTest.php
 test/Api/InvitesApiTest.php
 test/Api/MeApiTest.php
+test/Api/NissayaCardsApiTest.php
+test/Api/PaliWordFormsApiTest.php
+test/Api/PaliWordSuggestionsApiTest.php
 test/Api/PasswordResetsApiTest.php
 test/Api/ProgressApiTest.php
 test/Api/ReactionsApiTest.php
 test/Api/ReadingTimeApiTest.php
 test/Api/SearchApiTest.php
-test/Api/SearchSuggestApiTest.php
+test/Api/SearchSuggestionsApiTest.php
 test/Api/SessionsApiTest.php
 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
 test/Model/GetApiV3AdminAgentFeedback200ResponseDataInnerTest.php
@@ -546,24 +621,41 @@ test/Model/GetApiV3MeGroups200ResponseDataInnerTest.php
 test/Model/GetApiV3MeGroups200ResponseTest.php
 test/Model/GetApiV3MeReactions200ResponseDataInnerTest.php
 test/Model/GetApiV3MeReactions200ResponseTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategoryTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInnerTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataTermTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseDataTest.php
+test/Model/GetApiV3NissayaCardsEnding200ResponseTest.php
+test/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInnerTest.php
+test/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerTest.php
+test/Model/GetApiV3PaliWordFormsWord200ResponseMetaTest.php
+test/Model/GetApiV3PaliWordFormsWord200ResponseTest.php
+test/Model/GetApiV3PaliWordSuggestions200ResponseMetaTest.php
+test/Model/GetApiV3PaliWordSuggestions200ResponseTest.php
 test/Model/GetApiV3PasswordResetsToken200ResponseDataTest.php
 test/Model/GetApiV3PasswordResetsToken200ResponseTest.php
 test/Model/GetApiV3Progress200ResponseDataInnerTest.php
 test/Model/GetApiV3Progress200ResponseTest.php
 test/Model/GetApiV3ReactionsTally200ResponseDataInnerTest.php
 test/Model/GetApiV3ReactionsTally200ResponseTest.php
+test/Model/GetApiV3Search200ResponseDataInnerTest.php
+test/Model/GetApiV3Search200ResponseMetaFacetsValueInnerTest.php
+test/Model/GetApiV3Search200ResponseMetaTest.php
 test/Model/GetApiV3Search200ResponseTest.php
 test/Model/GetApiV3SearchSearch200ResponseTest.php
+test/Model/GetApiV3SearchSuggestions200ResponseDataInnerTest.php
+test/Model/GetApiV3SearchSuggestions200ResponseTest.php
 test/Model/GetApiV3TipitakaChannels200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaChannels200ResponseTest.php
 test/Model/GetApiV3TipitakaChapterChannelsBookPara200ResponseDataInnerChannelTest.php
 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
 test/Model/GetApiV3TipitakaReadingChannel200ResponseDataInnerTest.php
 test/Model/GetApiV3TipitakaReadingChannel200ResponseMetaTest.php
 test/Model/GetApiV3TipitakaReadingChannel200ResponseTest.php
@@ -575,6 +667,17 @@ 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
+test/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInnerTest.php
+test/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseMetaTest.php
+test/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseTest.php
+test/Model/GetApiV3Upgrade200ResponseTest.php
 test/Model/MarkupElementTest.php
 test/Model/MarkupNodeTest.php
 test/Model/MarkupTemplateTest.php
@@ -632,6 +735,8 @@ test/Model/PostApiV3MeReadingTime200ResponseDataTest.php
 test/Model/PostApiV3MeReadingTime200ResponseTest.php
 test/Model/PostApiV3MeReadingTimeRequestTest.php
 test/Model/PostApiV3PasswordResetsRequestTest.php
+test/Model/PostApiV3Search200ResponseMetaTest.php
+test/Model/PostApiV3Search200ResponseTest.php
 test/Model/PostApiV3SearchRequestTest.php
 test/Model/PostApiV3Sessions200ResponseDataTest.php
 test/Model/PostApiV3Sessions200ResponseTest.php

+ 502 - 0
api-test/client/lib/Api/NissayaCardsApi.php

@@ -0,0 +1,502 @@
+<?php
+/**
+ * NissayaCardsApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * NissayaCardsApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class NissayaCardsApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3NissayaCardsEnding' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3NissayaCardsEnding
+     *
+     * 缅文词尾卡片
+     *
+     * @param  string $ending 缅文词尾,如 သည် (required)
+     * @param  string|null $lang 语言,如 zh-Hans。缺省用界面语言(Accept-Language 协商的结果) (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3NissayaCardsEnding'] 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\GetApiV3NissayaCardsEnding200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3NissayaCardsEnding($ending, $lang = null, string $contentType = self::contentTypes['getApiV3NissayaCardsEnding'][0])
+    {
+        list($response) = $this->getApiV3NissayaCardsEndingWithHttpInfo($ending, $lang, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3NissayaCardsEndingWithHttpInfo
+     *
+     * 缅文词尾卡片
+     *
+     * @param  string $ending 缅文词尾,如 သည် (required)
+     * @param  string|null $lang 语言,如 zh-Hans。缺省用界面语言(Accept-Language 协商的结果) (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3NissayaCardsEnding'] 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\GetApiV3NissayaCardsEnding200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3NissayaCardsEndingWithHttpInfo($ending, $lang = null, string $contentType = self::contentTypes['getApiV3NissayaCardsEnding'][0])
+    {
+        $request = $this->getApiV3NissayaCardsEndingRequest($ending, $lang, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3NissayaCardsEndingAsync
+     *
+     * 缅文词尾卡片
+     *
+     * @param  string $ending 缅文词尾,如 သည် (required)
+     * @param  string|null $lang 语言,如 zh-Hans。缺省用界面语言(Accept-Language 协商的结果) (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3NissayaCardsEnding'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3NissayaCardsEndingAsync($ending, $lang = null, string $contentType = self::contentTypes['getApiV3NissayaCardsEnding'][0])
+    {
+        return $this->getApiV3NissayaCardsEndingAsyncWithHttpInfo($ending, $lang, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3NissayaCardsEndingAsyncWithHttpInfo
+     *
+     * 缅文词尾卡片
+     *
+     * @param  string $ending 缅文词尾,如 သည် (required)
+     * @param  string|null $lang 语言,如 zh-Hans。缺省用界面语言(Accept-Language 协商的结果) (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3NissayaCardsEnding'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3NissayaCardsEndingAsyncWithHttpInfo($ending, $lang = null, string $contentType = self::contentTypes['getApiV3NissayaCardsEnding'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200Response';
+        $request = $this->getApiV3NissayaCardsEndingRequest($ending, $lang, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3NissayaCardsEnding'
+     *
+     * @param  string $ending 缅文词尾,如 သည် (required)
+     * @param  string|null $lang 语言,如 zh-Hans。缺省用界面语言(Accept-Language 协商的结果) (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3NissayaCardsEnding'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3NissayaCardsEndingRequest($ending, $lang = null, string $contentType = self::contentTypes['getApiV3NissayaCardsEnding'][0])
+    {
+
+        // verify the required parameter 'ending' is set
+        if ($ending === null || (is_array($ending) && count($ending) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $ending when calling getApiV3NissayaCardsEnding'
+            );
+        }
+
+
+
+        $resourcePath = '/v3/nissaya-cards/{ending}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $lang,
+            'lang', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+        // path params
+        if ($ending !== null) {
+            $resourcePath = str_replace(
+                '{ending}',
+                ObjectSerializer::toPathValue($ending),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 487 - 0
api-test/client/lib/Api/PaliWordFormsApi.php

@@ -0,0 +1,487 @@
+<?php
+/**
+ * PaliWordFormsApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * PaliWordFormsApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class PaliWordFormsApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3PaliWordFormsWord' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3PaliWordFormsWord
+     *
+     * 词形展开
+     *
+     * @param  string $word 巴利词,如 vitakka (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordFormsWord'] 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\GetApiV3PaliWordFormsWord200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3PaliWordFormsWord($word, string $contentType = self::contentTypes['getApiV3PaliWordFormsWord'][0])
+    {
+        list($response) = $this->getApiV3PaliWordFormsWordWithHttpInfo($word, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3PaliWordFormsWordWithHttpInfo
+     *
+     * 词形展开
+     *
+     * @param  string $word 巴利词,如 vitakka (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordFormsWord'] 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\GetApiV3PaliWordFormsWord200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3PaliWordFormsWordWithHttpInfo($word, string $contentType = self::contentTypes['getApiV3PaliWordFormsWord'][0])
+    {
+        $request = $this->getApiV3PaliWordFormsWordRequest($word, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3PaliWordFormsWordAsync
+     *
+     * 词形展开
+     *
+     * @param  string $word 巴利词,如 vitakka (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordFormsWord'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3PaliWordFormsWordAsync($word, string $contentType = self::contentTypes['getApiV3PaliWordFormsWord'][0])
+    {
+        return $this->getApiV3PaliWordFormsWordAsyncWithHttpInfo($word, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3PaliWordFormsWordAsyncWithHttpInfo
+     *
+     * 词形展开
+     *
+     * @param  string $word 巴利词,如 vitakka (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordFormsWord'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3PaliWordFormsWordAsyncWithHttpInfo($word, string $contentType = self::contentTypes['getApiV3PaliWordFormsWord'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200Response';
+        $request = $this->getApiV3PaliWordFormsWordRequest($word, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3PaliWordFormsWord'
+     *
+     * @param  string $word 巴利词,如 vitakka (required)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordFormsWord'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3PaliWordFormsWordRequest($word, string $contentType = self::contentTypes['getApiV3PaliWordFormsWord'][0])
+    {
+
+        // verify the required parameter 'word' is set
+        if ($word === null || (is_array($word) && count($word) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $word when calling getApiV3PaliWordFormsWord'
+            );
+        }
+
+
+        $resourcePath = '/v3/pali-word-forms/{word}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+
+
+        // path params
+        if ($word !== null) {
+            $resourcePath = str_replace(
+                '{word}',
+                ObjectSerializer::toPathValue($word),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 503 - 0
api-test/client/lib/Api/PaliWordSuggestionsApi.php

@@ -0,0 +1,503 @@
+<?php
+/**
+ * PaliWordSuggestionsApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * PaliWordSuggestionsApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class PaliWordSuggestionsApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3PaliWordSuggestions' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3PaliWordSuggestions
+     *
+     * 巴利词补全
+     *
+     * @param  string $q 已输入的前缀 (required)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordSuggestions'] 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\GetApiV3PaliWordSuggestions200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3PaliWordSuggestions($q, $limit = 10, string $contentType = self::contentTypes['getApiV3PaliWordSuggestions'][0])
+    {
+        list($response) = $this->getApiV3PaliWordSuggestionsWithHttpInfo($q, $limit, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3PaliWordSuggestionsWithHttpInfo
+     *
+     * 巴利词补全
+     *
+     * @param  string $q 已输入的前缀 (required)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordSuggestions'] 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\GetApiV3PaliWordSuggestions200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3PaliWordSuggestionsWithHttpInfo($q, $limit = 10, string $contentType = self::contentTypes['getApiV3PaliWordSuggestions'][0])
+    {
+        $request = $this->getApiV3PaliWordSuggestionsRequest($q, $limit, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3PaliWordSuggestionsAsync
+     *
+     * 巴利词补全
+     *
+     * @param  string $q 已输入的前缀 (required)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordSuggestions'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3PaliWordSuggestionsAsync($q, $limit = 10, string $contentType = self::contentTypes['getApiV3PaliWordSuggestions'][0])
+    {
+        return $this->getApiV3PaliWordSuggestionsAsyncWithHttpInfo($q, $limit, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3PaliWordSuggestionsAsyncWithHttpInfo
+     *
+     * 巴利词补全
+     *
+     * @param  string $q 已输入的前缀 (required)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordSuggestions'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3PaliWordSuggestionsAsyncWithHttpInfo($q, $limit = 10, string $contentType = self::contentTypes['getApiV3PaliWordSuggestions'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200Response';
+        $request = $this->getApiV3PaliWordSuggestionsRequest($q, $limit, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3PaliWordSuggestions'
+     *
+     * @param  string $q 已输入的前缀 (required)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3PaliWordSuggestions'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3PaliWordSuggestionsRequest($q, $limit = 10, string $contentType = self::contentTypes['getApiV3PaliWordSuggestions'][0])
+    {
+
+        // verify the required parameter 'q' is set
+        if ($q === null || (is_array($q) && count($q) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $q when calling getApiV3PaliWordSuggestions'
+            );
+        }
+
+
+
+        $resourcePath = '/v3/pali-word-suggestions';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $limit,
+            'limit', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $q,
+            'q', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            true // required
+        ) ?? []);
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 158 - 101
api-test/client/lib/Api/SearchApi.php

@@ -136,29 +136,30 @@ class SearchApi
      *
      * 全文检索
      *
-     * @param  string $q 搜索关键词 (required)
-     * @param  int|null $page 页码 (optional, default to 1)
-     * @param  int|null $page_size 每页数量,上限 100 (optional, default to 20)
-     * @param  string|null $search_mode 检索模式 (optional, default to 'fuzzy')
-     * @param  string|null $resource_type 资源类型 (optional)
+     * @param  string $q 检索词 (required)
+     * @param  string|null $search_mode 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先 (optional, default to 'fuzzy')
+     * @param  string|null $resource_type 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语 (optional)
      * @param  string|null $resource_id 限定某个资源 id (optional)
      * @param  string|null $granularity 文档颗粒度 (optional)
-     * @param  string|null $language 语言 (optional)
-     * @param  string|null $category 文档分类,逗号分隔 (optional)
-     * @param  string|null $tags 标签过滤,逗号分隔 (optional)
-     * @param  string[]|null $page_refs 页码标记 (optional)
-     * @param  string[]|null $related_id 关联 id (optional)
-     * @param  string|null $author 按作者或译者过滤 (optional)
-     * @param  string|null $channel 按来源 channel 过滤 (optional)
+     * @param  string|null $language 文档语言,如 pi、zh、en (optional)
+     * @param  string|null $category 分类,逗号分隔,须全部命中 (optional)
+     * @param  string|null $tags 标签,逗号分隔,命中任一 (optional)
+     * @param  string[]|null $page_refs 页码标记,命中任一 (optional)
+     * @param  string[]|null $related_id 关联 id(经文段落是 &#x60;{book}-{para}&#x60;),命中任一 (optional)
+     * @param  string|null $author 作者或译者 (optional)
+     * @param  string|null $channel 来源 channel 的 uuid (optional)
+     * @param  bool|null $facets 是否在 &#x60;meta.facets&#x60; 里返回按 resource_type / language / category / granularity 的分面计数 (optional, default to false)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Search'] 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\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
-    public function getApiV3Search($q, $page = 1, $page_size = 20, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, string $contentType = self::contentTypes['getApiV3Search'][0])
+    public function getApiV3Search($q, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, $facets = false, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3Search'][0])
     {
-        list($response) = $this->getApiV3SearchWithHttpInfo($q, $page, $page_size, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $contentType);
+        list($response) = $this->getApiV3SearchWithHttpInfo($q, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $facets, $page, $per_page, $contentType);
         return $response;
     }
 
@@ -167,29 +168,30 @@ class SearchApi
      *
      * 全文检索
      *
-     * @param  string $q 搜索关键词 (required)
-     * @param  int|null $page 页码 (optional, default to 1)
-     * @param  int|null $page_size 每页数量,上限 100 (optional, default to 20)
-     * @param  string|null $search_mode 检索模式 (optional, default to 'fuzzy')
-     * @param  string|null $resource_type 资源类型 (optional)
+     * @param  string $q 检索词 (required)
+     * @param  string|null $search_mode 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先 (optional, default to 'fuzzy')
+     * @param  string|null $resource_type 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语 (optional)
      * @param  string|null $resource_id 限定某个资源 id (optional)
      * @param  string|null $granularity 文档颗粒度 (optional)
-     * @param  string|null $language 语言 (optional)
-     * @param  string|null $category 文档分类,逗号分隔 (optional)
-     * @param  string|null $tags 标签过滤,逗号分隔 (optional)
-     * @param  string[]|null $page_refs 页码标记 (optional)
-     * @param  string[]|null $related_id 关联 id (optional)
-     * @param  string|null $author 按作者或译者过滤 (optional)
-     * @param  string|null $channel 按来源 channel 过滤 (optional)
+     * @param  string|null $language 文档语言,如 pi、zh、en (optional)
+     * @param  string|null $category 分类,逗号分隔,须全部命中 (optional)
+     * @param  string|null $tags 标签,逗号分隔,命中任一 (optional)
+     * @param  string[]|null $page_refs 页码标记,命中任一 (optional)
+     * @param  string[]|null $related_id 关联 id(经文段落是 &#x60;{book}-{para}&#x60;),命中任一 (optional)
+     * @param  string|null $author 作者或译者 (optional)
+     * @param  string|null $channel 来源 channel 的 uuid (optional)
+     * @param  bool|null $facets 是否在 &#x60;meta.facets&#x60; 里返回按 resource_type / language / category / granularity 的分面计数 (optional, default to false)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Search'] 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\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function getApiV3SearchWithHttpInfo($q, $page = 1, $page_size = 20, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, string $contentType = self::contentTypes['getApiV3Search'][0])
+    public function getApiV3SearchWithHttpInfo($q, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, $facets = false, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3Search'][0])
     {
-        $request = $this->getApiV3SearchRequest($q, $page, $page_size, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $contentType);
+        $request = $this->getApiV3SearchRequest($q, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $facets, $page, $per_page, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -227,6 +229,12 @@ class SearchApi
                         $request,
                         $response,
                     );
+                case 503:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
             }
 
             
@@ -267,6 +275,14 @@ class SearchApi
                     );
                     $e->setResponseObject($data);
                     throw $e;
+                case 503:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
             }
         
 
@@ -279,28 +295,29 @@ class SearchApi
      *
      * 全文检索
      *
-     * @param  string $q 搜索关键词 (required)
-     * @param  int|null $page 页码 (optional, default to 1)
-     * @param  int|null $page_size 每页数量,上限 100 (optional, default to 20)
-     * @param  string|null $search_mode 检索模式 (optional, default to 'fuzzy')
-     * @param  string|null $resource_type 资源类型 (optional)
+     * @param  string $q 检索词 (required)
+     * @param  string|null $search_mode 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先 (optional, default to 'fuzzy')
+     * @param  string|null $resource_type 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语 (optional)
      * @param  string|null $resource_id 限定某个资源 id (optional)
      * @param  string|null $granularity 文档颗粒度 (optional)
-     * @param  string|null $language 语言 (optional)
-     * @param  string|null $category 文档分类,逗号分隔 (optional)
-     * @param  string|null $tags 标签过滤,逗号分隔 (optional)
-     * @param  string[]|null $page_refs 页码标记 (optional)
-     * @param  string[]|null $related_id 关联 id (optional)
-     * @param  string|null $author 按作者或译者过滤 (optional)
-     * @param  string|null $channel 按来源 channel 过滤 (optional)
+     * @param  string|null $language 文档语言,如 pi、zh、en (optional)
+     * @param  string|null $category 分类,逗号分隔,须全部命中 (optional)
+     * @param  string|null $tags 标签,逗号分隔,命中任一 (optional)
+     * @param  string[]|null $page_refs 页码标记,命中任一 (optional)
+     * @param  string[]|null $related_id 关联 id(经文段落是 &#x60;{book}-{para}&#x60;),命中任一 (optional)
+     * @param  string|null $author 作者或译者 (optional)
+     * @param  string|null $channel 来源 channel 的 uuid (optional)
+     * @param  bool|null $facets 是否在 &#x60;meta.facets&#x60; 里返回按 resource_type / language / category / granularity 的分面计数 (optional, default to false)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Search'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3SearchAsync($q, $page = 1, $page_size = 20, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, string $contentType = self::contentTypes['getApiV3Search'][0])
+    public function getApiV3SearchAsync($q, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, $facets = false, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3Search'][0])
     {
-        return $this->getApiV3SearchAsyncWithHttpInfo($q, $page, $page_size, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $contentType)
+        return $this->getApiV3SearchAsyncWithHttpInfo($q, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $facets, $page, $per_page, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -313,29 +330,30 @@ class SearchApi
      *
      * 全文检索
      *
-     * @param  string $q 搜索关键词 (required)
-     * @param  int|null $page 页码 (optional, default to 1)
-     * @param  int|null $page_size 每页数量,上限 100 (optional, default to 20)
-     * @param  string|null $search_mode 检索模式 (optional, default to 'fuzzy')
-     * @param  string|null $resource_type 资源类型 (optional)
+     * @param  string $q 检索词 (required)
+     * @param  string|null $search_mode 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先 (optional, default to 'fuzzy')
+     * @param  string|null $resource_type 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语 (optional)
      * @param  string|null $resource_id 限定某个资源 id (optional)
      * @param  string|null $granularity 文档颗粒度 (optional)
-     * @param  string|null $language 语言 (optional)
-     * @param  string|null $category 文档分类,逗号分隔 (optional)
-     * @param  string|null $tags 标签过滤,逗号分隔 (optional)
-     * @param  string[]|null $page_refs 页码标记 (optional)
-     * @param  string[]|null $related_id 关联 id (optional)
-     * @param  string|null $author 按作者或译者过滤 (optional)
-     * @param  string|null $channel 按来源 channel 过滤 (optional)
+     * @param  string|null $language 文档语言,如 pi、zh、en (optional)
+     * @param  string|null $category 分类,逗号分隔,须全部命中 (optional)
+     * @param  string|null $tags 标签,逗号分隔,命中任一 (optional)
+     * @param  string[]|null $page_refs 页码标记,命中任一 (optional)
+     * @param  string[]|null $related_id 关联 id(经文段落是 &#x60;{book}-{para}&#x60;),命中任一 (optional)
+     * @param  string|null $author 作者或译者 (optional)
+     * @param  string|null $channel 来源 channel 的 uuid (optional)
+     * @param  bool|null $facets 是否在 &#x60;meta.facets&#x60; 里返回按 resource_type / language / category / granularity 的分面计数 (optional, default to false)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Search'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3SearchAsyncWithHttpInfo($q, $page = 1, $page_size = 20, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, string $contentType = self::contentTypes['getApiV3Search'][0])
+    public function getApiV3SearchAsyncWithHttpInfo($q, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, $facets = false, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3Search'][0])
     {
         $returnType = '\WikipaliApi\Model\GetApiV3Search200Response';
-        $request = $this->getApiV3SearchRequest($q, $page, $page_size, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $contentType);
+        $request = $this->getApiV3SearchRequest($q, $search_mode, $resource_type, $resource_id, $granularity, $language, $category, $tags, $page_refs, $related_id, $author, $channel, $facets, $page, $per_page, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -376,26 +394,27 @@ class SearchApi
     /**
      * Create request for operation 'getApiV3Search'
      *
-     * @param  string $q 搜索关键词 (required)
-     * @param  int|null $page 页码 (optional, default to 1)
-     * @param  int|null $page_size 每页数量,上限 100 (optional, default to 20)
-     * @param  string|null $search_mode 检索模式 (optional, default to 'fuzzy')
-     * @param  string|null $resource_type 资源类型 (optional)
+     * @param  string $q 检索词 (required)
+     * @param  string|null $search_mode 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先 (optional, default to 'fuzzy')
+     * @param  string|null $resource_type 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语 (optional)
      * @param  string|null $resource_id 限定某个资源 id (optional)
      * @param  string|null $granularity 文档颗粒度 (optional)
-     * @param  string|null $language 语言 (optional)
-     * @param  string|null $category 文档分类,逗号分隔 (optional)
-     * @param  string|null $tags 标签过滤,逗号分隔 (optional)
-     * @param  string[]|null $page_refs 页码标记 (optional)
-     * @param  string[]|null $related_id 关联 id (optional)
-     * @param  string|null $author 按作者或译者过滤 (optional)
-     * @param  string|null $channel 按来源 channel 过滤 (optional)
+     * @param  string|null $language 文档语言,如 pi、zh、en (optional)
+     * @param  string|null $category 分类,逗号分隔,须全部命中 (optional)
+     * @param  string|null $tags 标签,逗号分隔,命中任一 (optional)
+     * @param  string[]|null $page_refs 页码标记,命中任一 (optional)
+     * @param  string[]|null $related_id 关联 id(经文段落是 &#x60;{book}-{para}&#x60;),命中任一 (optional)
+     * @param  string|null $author 作者或译者 (optional)
+     * @param  string|null $channel 来源 channel 的 uuid (optional)
+     * @param  bool|null $facets 是否在 &#x60;meta.facets&#x60; 里返回按 resource_type / language / category / granularity 的分面计数 (optional, default to false)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Search'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function getApiV3SearchRequest($q, $page = 1, $page_size = 20, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, string $contentType = self::contentTypes['getApiV3Search'][0])
+    public function getApiV3SearchRequest($q, $search_mode = 'fuzzy', $resource_type = null, $resource_id = null, $granularity = null, $language = null, $category = null, $tags = null, $page_refs = null, $related_id = null, $author = null, $channel = null, $facets = false, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3Search'][0])
     {
 
         // verify the required parameter 'q' is set
@@ -419,6 +438,7 @@ class SearchApi
 
 
 
+
         $resourcePath = '/v3/search';
         $formParams = [];
         $queryParams = [];
@@ -436,24 +456,6 @@ class SearchApi
             true // required
         ) ?? []);
         // query params
-        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
-            $page,
-            'page', // param base name
-            'integer', // openApiType
-            'form', // style
-            true, // explode
-            false // required
-        ) ?? []);
-        // query params
-        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
-            $page_size,
-            'page_size', // param base name
-            'integer', // openApiType
-            'form', // style
-            true, // explode
-            false // required
-        ) ?? []);
-        // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $search_mode,
             'search_mode', // param base name
@@ -552,6 +554,33 @@ class SearchApi
             true, // explode
             false // required
         ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $facets,
+            'facets', // param base name
+            'boolean', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
 
 
 
@@ -620,14 +649,14 @@ class SearchApi
     /**
      * Operation getApiV3SearchSearch
      *
-     * 按 id 取单条检索结果
+     * 按 id 取单条检索文档
      *
      * @param  string $search OpenSearch 文档 id (required)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSearch'] 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\GetApiV3SearchSearch200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\GetApiV3SearchSearch200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
     public function getApiV3SearchSearch($search, string $contentType = self::contentTypes['getApiV3SearchSearch'][0])
     {
@@ -638,14 +667,14 @@ class SearchApi
     /**
      * Operation getApiV3SearchSearchWithHttpInfo
      *
-     * 按 id 取单条检索结果
+     * 按 id 取单条检索文档
      *
      * @param  string $search OpenSearch 文档 id (required)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSearch'] 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\GetApiV3SearchSearch200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\GetApiV3SearchSearch200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
     public function getApiV3SearchSearchWithHttpInfo($search, string $contentType = self::contentTypes['getApiV3SearchSearch'][0])
     {
@@ -693,6 +722,12 @@ class SearchApi
                         $request,
                         $response,
                     );
+                case 503:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
             }
 
             
@@ -741,6 +776,14 @@ class SearchApi
                     );
                     $e->setResponseObject($data);
                     throw $e;
+                case 503:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
             }
         
 
@@ -751,7 +794,7 @@ class SearchApi
     /**
      * Operation getApiV3SearchSearchAsync
      *
-     * 按 id 取单条检索结果
+     * 按 id 取单条检索文档
      *
      * @param  string $search OpenSearch 文档 id (required)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSearch'] to see the possible values for this operation
@@ -772,7 +815,7 @@ class SearchApi
     /**
      * Operation getApiV3SearchSearchAsyncWithHttpInfo
      *
-     * 按 id 取单条检索结果
+     * 按 id 取单条检索文档
      *
      * @param  string $search OpenSearch 文档 id (required)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSearch'] to see the possible values for this operation
@@ -931,7 +974,7 @@ class SearchApi
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return \WikipaliApi\Model\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\PostApiV3Search200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
     public function postApiV3Search($post_api_v3_search_request, string $contentType = self::contentTypes['postApiV3Search'][0])
     {
@@ -949,7 +992,7 @@ class SearchApi
      *
      * @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\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\PostApiV3Search200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
     public function postApiV3SearchWithHttpInfo($post_api_v3_search_request, string $contentType = self::contentTypes['postApiV3Search'][0])
     {
@@ -981,7 +1024,7 @@ class SearchApi
             switch($statusCode) {
                 case 200:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\GetApiV3Search200Response',
+                        '\WikipaliApi\Model\PostApiV3Search200Response',
                         $request,
                         $response,
                     );
@@ -991,6 +1034,12 @@ class SearchApi
                         $request,
                         $response,
                     );
+                case 503:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
             }
 
             
@@ -1009,7 +1058,7 @@ class SearchApi
             }
 
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\GetApiV3Search200Response',
+                '\WikipaliApi\Model\PostApiV3Search200Response',
                 $request,
                 $response,
             );
@@ -1018,7 +1067,7 @@ class SearchApi
                 case 200:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\GetApiV3Search200Response',
+                        '\WikipaliApi\Model\PostApiV3Search200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -1031,6 +1080,14 @@ class SearchApi
                     );
                     $e->setResponseObject($data);
                     throw $e;
+                case 503:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
             }
         
 
@@ -1072,7 +1129,7 @@ class SearchApi
      */
     public function postApiV3SearchAsyncWithHttpInfo($post_api_v3_search_request, string $contentType = self::contentTypes['postApiV3Search'][0])
     {
-        $returnType = '\WikipaliApi\Model\GetApiV3Search200Response';
+        $returnType = '\WikipaliApi\Model\PostApiV3Search200Response';
         $request = $this->postApiV3SearchRequest($post_api_v3_search_request, $contentType);
 
         return $this->client

+ 64 - 65
api-test/client/lib/Api/SearchSuggestApi.php → api-test/client/lib/Api/SearchSuggestionsApi.php

@@ -1,6 +1,6 @@
 <?php
 /**
- * SearchSuggestApi
+ * SearchSuggestionsApi
  * PHP version 8.1
  *
  * @category Class
@@ -43,14 +43,14 @@ use WikipaliApi\HeaderSelector;
 use WikipaliApi\ObjectSerializer;
 
 /**
- * SearchSuggestApi Class Doc Comment
+ * SearchSuggestionsApi Class Doc Comment
  *
  * @category Class
  * @package  WikipaliApi
  * @author   OpenAPI Generator team
  * @link     https://openapi-generator.tech
  */
-class SearchSuggestApi
+class SearchSuggestionsApi
 {
     /**
      * @var ClientInterface
@@ -74,7 +74,7 @@ class SearchSuggestApi
 
     /** @var string[] $contentTypes **/
     public const contentTypes = [
-        'getApiV3SearchSuggest' => [
+        'getApiV3SearchSuggestions' => [
             'application/json',
         ],
     ];
@@ -126,44 +126,42 @@ class SearchSuggestApi
     }
 
     /**
-     * Operation getApiV3SearchSuggest
+     * Operation getApiV3SearchSuggestions
      *
-     * 搜索建议(自动补全)
+     * 搜索建议
      *
-     * @param  string $q 已输入的查询文本 (required)
-     * @param  string|null $fields 在哪些字段上补全,逗号分隔;不传则全查 (optional)
-     * @param  string|null $language 语言过滤 (optional)
-     * @param  int|null $limit 每个字段返回的建议数,上限 50 (optional, default to 10)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggest'] to see the possible values for this operation
+     * @param  string $q 已输入的前缀 (required)
+     * @param  string|null $fields 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部 (optional)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggestions'] 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\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails
+     * @return \WikipaliApi\Model\GetApiV3SearchSuggestions200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
-    public function getApiV3SearchSuggest($q, $fields = null, $language = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggest'][0])
+    public function getApiV3SearchSuggestions($q, $fields = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggestions'][0])
     {
-        list($response) = $this->getApiV3SearchSuggestWithHttpInfo($q, $fields, $language, $limit, $contentType);
+        list($response) = $this->getApiV3SearchSuggestionsWithHttpInfo($q, $fields, $limit, $contentType);
         return $response;
     }
 
     /**
-     * Operation getApiV3SearchSuggestWithHttpInfo
+     * Operation getApiV3SearchSuggestionsWithHttpInfo
      *
-     * 搜索建议(自动补全)
+     * 搜索建议
      *
-     * @param  string $q 已输入的查询文本 (required)
-     * @param  string|null $fields 在哪些字段上补全,逗号分隔;不传则全查 (optional)
-     * @param  string|null $language 语言过滤 (optional)
-     * @param  int|null $limit 每个字段返回的建议数,上限 50 (optional, default to 10)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggest'] to see the possible values for this operation
+     * @param  string $q 已输入的前缀 (required)
+     * @param  string|null $fields 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部 (optional)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggestions'] 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\GetApiV3Search200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\GetApiV3SearchSuggestions200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function getApiV3SearchSuggestWithHttpInfo($q, $fields = null, $language = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggest'][0])
+    public function getApiV3SearchSuggestionsWithHttpInfo($q, $fields = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggestions'][0])
     {
-        $request = $this->getApiV3SearchSuggestRequest($q, $fields, $language, $limit, $contentType);
+        $request = $this->getApiV3SearchSuggestionsRequest($q, $fields, $limit, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -191,7 +189,7 @@ class SearchSuggestApi
             switch($statusCode) {
                 case 200:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\GetApiV3Search200Response',
+                        '\WikipaliApi\Model\GetApiV3SearchSuggestions200Response',
                         $request,
                         $response,
                     );
@@ -201,6 +199,12 @@ class SearchSuggestApi
                         $request,
                         $response,
                     );
+                case 503:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
             }
 
             
@@ -219,7 +223,7 @@ class SearchSuggestApi
             }
 
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\GetApiV3Search200Response',
+                '\WikipaliApi\Model\GetApiV3SearchSuggestions200Response',
                 $request,
                 $response,
             );
@@ -228,7 +232,7 @@ class SearchSuggestApi
                 case 200:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\GetApiV3Search200Response',
+                        '\WikipaliApi\Model\GetApiV3SearchSuggestions200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -241,6 +245,14 @@ class SearchSuggestApi
                     );
                     $e->setResponseObject($data);
                     throw $e;
+                case 503:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
             }
         
 
@@ -249,22 +261,21 @@ class SearchSuggestApi
     }
 
     /**
-     * Operation getApiV3SearchSuggestAsync
+     * Operation getApiV3SearchSuggestionsAsync
      *
-     * 搜索建议(自动补全)
+     * 搜索建议
      *
-     * @param  string $q 已输入的查询文本 (required)
-     * @param  string|null $fields 在哪些字段上补全,逗号分隔;不传则全查 (optional)
-     * @param  string|null $language 语言过滤 (optional)
-     * @param  int|null $limit 每个字段返回的建议数,上限 50 (optional, default to 10)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggest'] to see the possible values for this operation
+     * @param  string $q 已输入的前缀 (required)
+     * @param  string|null $fields 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部 (optional)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggestions'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3SearchSuggestAsync($q, $fields = null, $language = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggest'][0])
+    public function getApiV3SearchSuggestionsAsync($q, $fields = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggestions'][0])
     {
-        return $this->getApiV3SearchSuggestAsyncWithHttpInfo($q, $fields, $language, $limit, $contentType)
+        return $this->getApiV3SearchSuggestionsAsyncWithHttpInfo($q, $fields, $limit, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -273,23 +284,22 @@ class SearchSuggestApi
     }
 
     /**
-     * Operation getApiV3SearchSuggestAsyncWithHttpInfo
+     * Operation getApiV3SearchSuggestionsAsyncWithHttpInfo
      *
-     * 搜索建议(自动补全)
+     * 搜索建议
      *
-     * @param  string $q 已输入的查询文本 (required)
-     * @param  string|null $fields 在哪些字段上补全,逗号分隔;不传则全查 (optional)
-     * @param  string|null $language 语言过滤 (optional)
-     * @param  int|null $limit 每个字段返回的建议数,上限 50 (optional, default to 10)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggest'] to see the possible values for this operation
+     * @param  string $q 已输入的前缀 (required)
+     * @param  string|null $fields 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部 (optional)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggestions'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3SearchSuggestAsyncWithHttpInfo($q, $fields = null, $language = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggest'][0])
+    public function getApiV3SearchSuggestionsAsyncWithHttpInfo($q, $fields = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggestions'][0])
     {
-        $returnType = '\WikipaliApi\Model\GetApiV3Search200Response';
-        $request = $this->getApiV3SearchSuggestRequest($q, $fields, $language, $limit, $contentType);
+        $returnType = '\WikipaliApi\Model\GetApiV3SearchSuggestions200Response';
+        $request = $this->getApiV3SearchSuggestionsRequest($q, $fields, $limit, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -328,32 +338,30 @@ class SearchSuggestApi
     }
 
     /**
-     * Create request for operation 'getApiV3SearchSuggest'
+     * Create request for operation 'getApiV3SearchSuggestions'
      *
-     * @param  string $q 已输入的查询文本 (required)
-     * @param  string|null $fields 在哪些字段上补全,逗号分隔;不传则全查 (optional)
-     * @param  string|null $language 语言过滤 (optional)
-     * @param  int|null $limit 每个字段返回的建议数,上限 50 (optional, default to 10)
-     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggest'] to see the possible values for this operation
+     * @param  string $q 已输入的前缀 (required)
+     * @param  string|null $fields 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部 (optional)
+     * @param  int|null $limit 最多返回几条,上限 50 (optional, default to 10)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3SearchSuggestions'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function getApiV3SearchSuggestRequest($q, $fields = null, $language = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggest'][0])
+    public function getApiV3SearchSuggestionsRequest($q, $fields = null, $limit = 10, string $contentType = self::contentTypes['getApiV3SearchSuggestions'][0])
     {
 
         // verify the required parameter 'q' is set
         if ($q === null || (is_array($q) && count($q) === 0)) {
             throw new \InvalidArgumentException(
-                'Missing the required parameter $q when calling getApiV3SearchSuggest'
+                'Missing the required parameter $q when calling getApiV3SearchSuggestions'
             );
         }
 
 
 
 
-
-        $resourcePath = '/v3/search-suggest';
+        $resourcePath = '/v3/search-suggestions';
         $formParams = [];
         $queryParams = [];
         $headerParams = [];
@@ -379,15 +387,6 @@ class SearchSuggestApi
             false // required
         ) ?? []);
         // query params
-        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
-            $language,
-            'language', // param base name
-            'string', // openApiType
-            'form', // style
-            true, // explode
-            false // required
-        ) ?? []);
-        // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $limit,
             'limit', // param base name

+ 23 - 23
api-test/client/lib/Api/StudiosApi.php

@@ -626,11 +626,11 @@ class StudiosApi
      * studio 的术语列表
      *
      * @param  string $studio 用户或团队的 uuid (required)
+     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $search 按词、释义搜索 (optional)
      * @param  string|null $quality 质量;pending 含未评级的 (optional)
      * @param  string|null $category 百科分类 (optional)
-     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  string|null $order 排序字段 (optional, default to 'updated_at')
      * @param  string|null $dir 排序方向 (optional)
      * @param  int|null $page 页码 (optional)
@@ -640,9 +640,9 @@ class StudiosApi
      * @throws \InvalidArgumentException
      * @return \WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails
      */
-    public function getApiV3StudiosStudioTerms($studio, $per_page = 20, $search = null, $quality = null, $category = null, $general = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
+    public function getApiV3StudiosStudioTerms($studio, $general = null, $per_page = 20, $search = null, $quality = null, $category = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
     {
-        list($response) = $this->getApiV3StudiosStudioTermsWithHttpInfo($studio, $per_page, $search, $quality, $category, $general, $order, $dir, $page, $contentType);
+        list($response) = $this->getApiV3StudiosStudioTermsWithHttpInfo($studio, $general, $per_page, $search, $quality, $category, $order, $dir, $page, $contentType);
         return $response;
     }
 
@@ -652,11 +652,11 @@ class StudiosApi
      * studio 的术语列表
      *
      * @param  string $studio 用户或团队的 uuid (required)
+     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $search 按词、释义搜索 (optional)
      * @param  string|null $quality 质量;pending 含未评级的 (optional)
      * @param  string|null $category 百科分类 (optional)
-     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  string|null $order 排序字段 (optional, default to 'updated_at')
      * @param  string|null $dir 排序方向 (optional)
      * @param  int|null $page 页码 (optional)
@@ -666,9 +666,9 @@ class StudiosApi
      * @throws \InvalidArgumentException
      * @return array of \WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function getApiV3StudiosStudioTermsWithHttpInfo($studio, $per_page = 20, $search = null, $quality = null, $category = null, $general = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
+    public function getApiV3StudiosStudioTermsWithHttpInfo($studio, $general = null, $per_page = 20, $search = null, $quality = null, $category = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
     {
-        $request = $this->getApiV3StudiosStudioTermsRequest($studio, $per_page, $search, $quality, $category, $general, $order, $dir, $page, $contentType);
+        $request = $this->getApiV3StudiosStudioTermsRequest($studio, $general, $per_page, $search, $quality, $category, $order, $dir, $page, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -787,11 +787,11 @@ class StudiosApi
      * studio 的术语列表
      *
      * @param  string $studio 用户或团队的 uuid (required)
+     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $search 按词、释义搜索 (optional)
      * @param  string|null $quality 质量;pending 含未评级的 (optional)
      * @param  string|null $category 百科分类 (optional)
-     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  string|null $order 排序字段 (optional, default to 'updated_at')
      * @param  string|null $dir 排序方向 (optional)
      * @param  int|null $page 页码 (optional)
@@ -800,9 +800,9 @@ class StudiosApi
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3StudiosStudioTermsAsync($studio, $per_page = 20, $search = null, $quality = null, $category = null, $general = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
+    public function getApiV3StudiosStudioTermsAsync($studio, $general = null, $per_page = 20, $search = null, $quality = null, $category = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
     {
-        return $this->getApiV3StudiosStudioTermsAsyncWithHttpInfo($studio, $per_page, $search, $quality, $category, $general, $order, $dir, $page, $contentType)
+        return $this->getApiV3StudiosStudioTermsAsyncWithHttpInfo($studio, $general, $per_page, $search, $quality, $category, $order, $dir, $page, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -816,11 +816,11 @@ class StudiosApi
      * studio 的术语列表
      *
      * @param  string $studio 用户或团队的 uuid (required)
+     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $search 按词、释义搜索 (optional)
      * @param  string|null $quality 质量;pending 含未评级的 (optional)
      * @param  string|null $category 百科分类 (optional)
-     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  string|null $order 排序字段 (optional, default to 'updated_at')
      * @param  string|null $dir 排序方向 (optional)
      * @param  int|null $page 页码 (optional)
@@ -829,10 +829,10 @@ class StudiosApi
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3StudiosStudioTermsAsyncWithHttpInfo($studio, $per_page = 20, $search = null, $quality = null, $category = null, $general = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
+    public function getApiV3StudiosStudioTermsAsyncWithHttpInfo($studio, $general = null, $per_page = 20, $search = null, $quality = null, $category = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
     {
         $returnType = '\WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response';
-        $request = $this->getApiV3StudiosStudioTermsRequest($studio, $per_page, $search, $quality, $category, $general, $order, $dir, $page, $contentType);
+        $request = $this->getApiV3StudiosStudioTermsRequest($studio, $general, $per_page, $search, $quality, $category, $order, $dir, $page, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -874,11 +874,11 @@ class StudiosApi
      * Create request for operation 'getApiV3StudiosStudioTerms'
      *
      * @param  string $studio 用户或团队的 uuid (required)
+     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $search 按词、释义搜索 (optional)
      * @param  string|null $quality 质量;pending 含未评级的 (optional)
      * @param  string|null $category 百科分类 (optional)
-     * @param  bool|null $general 只要 studio 级术语(不属于任何 channel) (optional)
      * @param  string|null $order 排序字段 (optional, default to 'updated_at')
      * @param  string|null $dir 排序方向 (optional)
      * @param  int|null $page 页码 (optional)
@@ -887,7 +887,7 @@ class StudiosApi
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function getApiV3StudiosStudioTermsRequest($studio, $per_page = 20, $search = null, $quality = null, $category = null, $general = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
+    public function getApiV3StudiosStudioTermsRequest($studio, $general = null, $per_page = 20, $search = null, $quality = null, $category = null, $order = 'updated_at', $dir = null, $page = null, string $contentType = self::contentTypes['getApiV3StudiosStudioTerms'][0])
     {
 
         // verify the required parameter 'studio' is set
@@ -913,6 +913,15 @@ class StudiosApi
         $httpBody = '';
         $multipart = false;
 
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $general,
+            'general', // param base name
+            'boolean', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
         // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $per_page,
@@ -950,15 +959,6 @@ class StudiosApi
             false // required
         ) ?? []);
         // query params
-        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
-            $general,
-            'general', // param base name
-            'boolean', // openApiType
-            'form', // style
-            true, // explode
-            false // required
-        ) ?? []);
-        // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $order,
             'order', // param base name

+ 23 - 23
api-test/client/lib/Api/TermsApi.php

@@ -458,11 +458,11 @@ class TermsApi
      * 按词查术语
      *
      * @param  string $word 巴利词,逗号分隔,最多 50 个 (required)
+     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $tag 义项;传空串只要没有义项的 (optional)
      * @param  string|null $channel 只要这个 channel 的 (optional)
      * @param  string|null $language 只要这个语言的 (optional)
-     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $page 页码 (optional)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Terms'] to see the possible values for this operation
      *
@@ -470,9 +470,9 @@ class TermsApi
      * @throws \InvalidArgumentException
      * @return \WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response|\WikipaliApi\Model\ProblemDetails
      */
-    public function getApiV3Terms($word, $per_page = 20, $tag = null, $channel = null, $language = null, $with_body = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
+    public function getApiV3Terms($word, $with_body = null, $per_page = 20, $tag = null, $channel = null, $language = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
     {
-        list($response) = $this->getApiV3TermsWithHttpInfo($word, $per_page, $tag, $channel, $language, $with_body, $page, $contentType);
+        list($response) = $this->getApiV3TermsWithHttpInfo($word, $with_body, $per_page, $tag, $channel, $language, $page, $contentType);
         return $response;
     }
 
@@ -482,11 +482,11 @@ class TermsApi
      * 按词查术语
      *
      * @param  string $word 巴利词,逗号分隔,最多 50 个 (required)
+     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $tag 义项;传空串只要没有义项的 (optional)
      * @param  string|null $channel 只要这个 channel 的 (optional)
      * @param  string|null $language 只要这个语言的 (optional)
-     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $page 页码 (optional)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Terms'] to see the possible values for this operation
      *
@@ -494,9 +494,9 @@ class TermsApi
      * @throws \InvalidArgumentException
      * @return array of \WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
      */
-    public function getApiV3TermsWithHttpInfo($word, $per_page = 20, $tag = null, $channel = null, $language = null, $with_body = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
+    public function getApiV3TermsWithHttpInfo($word, $with_body = null, $per_page = 20, $tag = null, $channel = null, $language = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
     {
-        $request = $this->getApiV3TermsRequest($word, $per_page, $tag, $channel, $language, $with_body, $page, $contentType);
+        $request = $this->getApiV3TermsRequest($word, $with_body, $per_page, $tag, $channel, $language, $page, $contentType);
 
         try {
             $options = $this->createHttpClientOption();
@@ -587,20 +587,20 @@ class TermsApi
      * 按词查术语
      *
      * @param  string $word 巴利词,逗号分隔,最多 50 个 (required)
+     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $tag 义项;传空串只要没有义项的 (optional)
      * @param  string|null $channel 只要这个 channel 的 (optional)
      * @param  string|null $language 只要这个语言的 (optional)
-     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $page 页码 (optional)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Terms'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3TermsAsync($word, $per_page = 20, $tag = null, $channel = null, $language = null, $with_body = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
+    public function getApiV3TermsAsync($word, $with_body = null, $per_page = 20, $tag = null, $channel = null, $language = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
     {
-        return $this->getApiV3TermsAsyncWithHttpInfo($word, $per_page, $tag, $channel, $language, $with_body, $page, $contentType)
+        return $this->getApiV3TermsAsyncWithHttpInfo($word, $with_body, $per_page, $tag, $channel, $language, $page, $contentType)
             ->then(
                 function ($response) {
                     return $response[0];
@@ -614,21 +614,21 @@ class TermsApi
      * 按词查术语
      *
      * @param  string $word 巴利词,逗号分隔,最多 50 个 (required)
+     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $tag 义项;传空串只要没有义项的 (optional)
      * @param  string|null $channel 只要这个 channel 的 (optional)
      * @param  string|null $language 只要这个语言的 (optional)
-     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $page 页码 (optional)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Terms'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Promise\PromiseInterface
      */
-    public function getApiV3TermsAsyncWithHttpInfo($word, $per_page = 20, $tag = null, $channel = null, $language = null, $with_body = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
+    public function getApiV3TermsAsyncWithHttpInfo($word, $with_body = null, $per_page = 20, $tag = null, $channel = null, $language = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
     {
         $returnType = '\WikipaliApi\Model\GetApiV3ChannelsChannelTerms200Response';
-        $request = $this->getApiV3TermsRequest($word, $per_page, $tag, $channel, $language, $with_body, $page, $contentType);
+        $request = $this->getApiV3TermsRequest($word, $with_body, $per_page, $tag, $channel, $language, $page, $contentType);
 
         return $this->client
             ->sendAsync($request, $this->createHttpClientOption())
@@ -670,18 +670,18 @@ class TermsApi
      * Create request for operation 'getApiV3Terms'
      *
      * @param  string $word 巴利词,逗号分隔,最多 50 个 (required)
+     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $per_page 每页条数,最大 200 (optional, default to 20)
      * @param  string|null $tag 义项;传空串只要没有义项的 (optional)
      * @param  string|null $channel 只要这个 channel 的 (optional)
      * @param  string|null $language 只要这个语言的 (optional)
-     * @param  bool|null $with_body 每条都带渲染后的正文 &#x60;body&#x60; (optional)
      * @param  int|null $page 页码 (optional)
      * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3Terms'] to see the possible values for this operation
      *
      * @throws \InvalidArgumentException
      * @return \GuzzleHttp\Psr7\Request
      */
-    public function getApiV3TermsRequest($word, $per_page = 20, $tag = null, $channel = null, $language = null, $with_body = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
+    public function getApiV3TermsRequest($word, $with_body = null, $per_page = 20, $tag = null, $channel = null, $language = null, $page = null, string $contentType = self::contentTypes['getApiV3Terms'][0])
     {
 
         // verify the required parameter 'word' is set
@@ -705,6 +705,15 @@ class TermsApi
         $httpBody = '';
         $multipart = false;
 
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $with_body,
+            'with_body', // param base name
+            'boolean', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
         // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $per_page,
@@ -751,15 +760,6 @@ class TermsApi
             false // required
         ) ?? []);
         // query params
-        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
-            $with_body,
-            'with_body', // param base name
-            'boolean', // openApiType
-            'form', // style
-            true, // explode
-            false // required
-        ) ?? []);
-        // query params
         $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
             $page,
             'page', // param base name

+ 517 - 0
api-test/client/lib/Api/TipitakaPageNumbersApi.php

@@ -0,0 +1,517 @@
+<?php
+/**
+ * TipitakaPageNumbersApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * TipitakaPageNumbersApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class TipitakaPageNumbersApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3TipitakaPageNumbersPage' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3TipitakaPageNumbersPage
+     *
+     * 按页码找段落
+     *
+     * @param  int $page 页码(或 CS 段落号) (required)
+     * @param  string|null $edition 只要这个版本 (optional)
+     * @param  int|null $volume 只要这一卷 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaPageNumbersPage'] 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\GetApiV3TipitakaPageNumbersPage200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3TipitakaPageNumbersPage($page, $edition = null, $volume = null, string $contentType = self::contentTypes['getApiV3TipitakaPageNumbersPage'][0])
+    {
+        list($response) = $this->getApiV3TipitakaPageNumbersPageWithHttpInfo($page, $edition, $volume, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3TipitakaPageNumbersPageWithHttpInfo
+     *
+     * 按页码找段落
+     *
+     * @param  int $page 页码(或 CS 段落号) (required)
+     * @param  string|null $edition 只要这个版本 (optional)
+     * @param  int|null $volume 只要这一卷 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaPageNumbersPage'] 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\GetApiV3TipitakaPageNumbersPage200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3TipitakaPageNumbersPageWithHttpInfo($page, $edition = null, $volume = null, string $contentType = self::contentTypes['getApiV3TipitakaPageNumbersPage'][0])
+    {
+        $request = $this->getApiV3TipitakaPageNumbersPageRequest($page, $edition, $volume, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3TipitakaPageNumbersPageAsync
+     *
+     * 按页码找段落
+     *
+     * @param  int $page 页码(或 CS 段落号) (required)
+     * @param  string|null $edition 只要这个版本 (optional)
+     * @param  int|null $volume 只要这一卷 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaPageNumbersPage'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaPageNumbersPageAsync($page, $edition = null, $volume = null, string $contentType = self::contentTypes['getApiV3TipitakaPageNumbersPage'][0])
+    {
+        return $this->getApiV3TipitakaPageNumbersPageAsyncWithHttpInfo($page, $edition, $volume, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3TipitakaPageNumbersPageAsyncWithHttpInfo
+     *
+     * 按页码找段落
+     *
+     * @param  int $page 页码(或 CS 段落号) (required)
+     * @param  string|null $edition 只要这个版本 (optional)
+     * @param  int|null $volume 只要这一卷 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaPageNumbersPage'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaPageNumbersPageAsyncWithHttpInfo($page, $edition = null, $volume = null, string $contentType = self::contentTypes['getApiV3TipitakaPageNumbersPage'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200Response';
+        $request = $this->getApiV3TipitakaPageNumbersPageRequest($page, $edition, $volume, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3TipitakaPageNumbersPage'
+     *
+     * @param  int $page 页码(或 CS 段落号) (required)
+     * @param  string|null $edition 只要这个版本 (optional)
+     * @param  int|null $volume 只要这一卷 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaPageNumbersPage'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3TipitakaPageNumbersPageRequest($page, $edition = null, $volume = null, string $contentType = self::contentTypes['getApiV3TipitakaPageNumbersPage'][0])
+    {
+
+        // verify the required parameter 'page' is set
+        if ($page === null || (is_array($page) && count($page) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $page when calling getApiV3TipitakaPageNumbersPage'
+            );
+        }
+
+
+
+
+        $resourcePath = '/v3/tipitaka-page-numbers/{page}';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $edition,
+            'edition', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $volume,
+            'volume', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+        // path params
+        if ($page !== null) {
+            $resourcePath = str_replace(
+                '{page}',
+                ObjectSerializer::toPathValue($page),
+                $resourcePath
+            );
+        }
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 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 = [];

+ 857 - 0
api-test/client/lib/Api/TipitakaWordParagraphsApi.php

@@ -0,0 +1,857 @@
+<?php
+/**
+ * TipitakaWordParagraphsApi
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Api;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\ClientInterface;
+use GuzzleHttp\Exception\ConnectException;
+use GuzzleHttp\Exception\RequestException;
+use GuzzleHttp\Psr7\MultipartStream;
+use GuzzleHttp\Psr7\Request;
+use GuzzleHttp\RequestOptions;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseInterface;
+use WikipaliApi\ApiException;
+use WikipaliApi\Configuration;
+use WikipaliApi\FormDataProcessor;
+use WikipaliApi\HeaderSelector;
+use WikipaliApi\ObjectSerializer;
+
+/**
+ * TipitakaWordParagraphsApi Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+class TipitakaWordParagraphsApi
+{
+    /**
+     * @var ClientInterface
+     */
+    protected $client;
+
+    /**
+     * @var Configuration
+     */
+    protected $config;
+
+    /**
+     * @var HeaderSelector
+     */
+    protected $headerSelector;
+
+    /**
+     * @var int Host index
+     */
+    protected $hostIndex;
+
+    /** @var string[] $contentTypes **/
+    public const contentTypes = [
+        'getApiV3TipitakaWordParagraphs' => [
+            'application/json',
+        ],
+        'getApiV3TipitakaWordParagraphsAggregate' => [
+            'application/json',
+        ],
+    ];
+
+    /**
+     * @param ClientInterface $client
+     * @param Configuration   $config
+     * @param HeaderSelector  $selector
+     * @param int             $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
+     */
+    public function __construct(
+        ?ClientInterface $client = null,
+        ?Configuration $config = null,
+        ?HeaderSelector $selector = null,
+        int $hostIndex = 0
+    ) {
+        $this->client = $client ?: new Client();
+        $this->config = $config ?: Configuration::getDefaultConfiguration();
+        $this->headerSelector = $selector ?: new HeaderSelector();
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Set the host index
+     *
+     * @param int $hostIndex Host index (required)
+     */
+    public function setHostIndex($hostIndex): void
+    {
+        $this->hostIndex = $hostIndex;
+    }
+
+    /**
+     * Get the host index
+     *
+     * @return int Host index
+     */
+    public function getHostIndex()
+    {
+        return $this->hostIndex;
+    }
+
+    /**
+     * @return Configuration
+     */
+    public function getConfig()
+    {
+        return $this->config;
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphs
+     *
+     * 按词形找段落
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string|null $book_id 只看这些书,逗号分隔的 book_id(见 &#x60;/aggregate&#x60;) (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphs'] 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\GetApiV3TipitakaWordParagraphs200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3TipitakaWordParagraphs($words, $bold = null, $book_id = null, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphs'][0])
+    {
+        list($response) = $this->getApiV3TipitakaWordParagraphsWithHttpInfo($words, $bold, $book_id, $page, $per_page, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsWithHttpInfo
+     *
+     * 按词形找段落
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string|null $book_id 只看这些书,逗号分隔的 book_id(见 &#x60;/aggregate&#x60;) (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphs'] 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\GetApiV3TipitakaWordParagraphs200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3TipitakaWordParagraphsWithHttpInfo($words, $bold = null, $book_id = null, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphs'][0])
+    {
+        $request = $this->getApiV3TipitakaWordParagraphsRequest($words, $bold, $book_id, $page, $per_page, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAsync
+     *
+     * 按词形找段落
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string|null $book_id 只看这些书,逗号分隔的 book_id(见 &#x60;/aggregate&#x60;) (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphs'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaWordParagraphsAsync($words, $bold = null, $book_id = null, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphs'][0])
+    {
+        return $this->getApiV3TipitakaWordParagraphsAsyncWithHttpInfo($words, $bold, $book_id, $page, $per_page, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAsyncWithHttpInfo
+     *
+     * 按词形找段落
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string|null $book_id 只看这些书,逗号分隔的 book_id(见 &#x60;/aggregate&#x60;) (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphs'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaWordParagraphsAsyncWithHttpInfo($words, $bold = null, $book_id = null, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphs'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200Response';
+        $request = $this->getApiV3TipitakaWordParagraphsRequest($words, $bold, $book_id, $page, $per_page, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3TipitakaWordParagraphs'
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string|null $book_id 只看这些书,逗号分隔的 book_id(见 &#x60;/aggregate&#x60;) (optional)
+     * @param  int|null $page 页码 (optional, default to 1)
+     * @param  int|null $per_page 每页条数,上限 100 (optional, default to 20)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphs'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3TipitakaWordParagraphsRequest($words, $bold = null, $book_id = null, $page = 1, $per_page = 20, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphs'][0])
+    {
+
+        // verify the required parameter 'words' is set
+        if ($words === null || (is_array($words) && count($words) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $words when calling getApiV3TipitakaWordParagraphs'
+            );
+        }
+
+
+
+
+
+
+        $resourcePath = '/v3/tipitaka-word-paragraphs';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $words,
+            'words', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            true // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $bold,
+            'bold', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $book_id,
+            'book_id', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $page,
+            'page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $per_page,
+            'per_page', // param base name
+            'integer', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAggregate
+     *
+     * 按书统计命中
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'] 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\GetApiV3TipitakaWordParagraphsAggregate200Response|\WikipaliApi\Model\ProblemDetails
+     */
+    public function getApiV3TipitakaWordParagraphsAggregate($words, $bold = null, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'][0])
+    {
+        list($response) = $this->getApiV3TipitakaWordParagraphsAggregateWithHttpInfo($words, $bold, $contentType);
+        return $response;
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAggregateWithHttpInfo
+     *
+     * 按书统计命中
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'] 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\GetApiV3TipitakaWordParagraphsAggregate200Response|\WikipaliApi\Model\ProblemDetails, HTTP status code, HTTP response headers (array of strings)
+     */
+    public function getApiV3TipitakaWordParagraphsAggregateWithHttpInfo($words, $bold = null, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'][0])
+    {
+        $request = $this->getApiV3TipitakaWordParagraphsAggregateRequest($words, $bold, $contentType);
+
+        try {
+            $options = $this->createHttpClientOption();
+            try {
+                $response = $this->client->send($request, $options);
+            } catch (RequestException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+                    $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+                );
+            } catch (ConnectException $e) {
+                throw new ApiException(
+                    "[{$e->getCode()}] {$e->getMessage()}",
+                    (int) $e->getCode(),
+                    null,
+                    null
+                );
+            }
+
+            $statusCode = $response->getStatusCode();
+
+
+            switch($statusCode) {
+                case 200:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200Response',
+                        $request,
+                        $response,
+                    );
+                case 422:
+                    return $this->handleResponseWithDataType(
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $request,
+                        $response,
+                    );
+            }
+
+            
+
+            if ($statusCode < 200 || $statusCode > 299) {
+                throw new ApiException(
+                    sprintf(
+                        '[%d] Error connecting to the API (%s)',
+                        $statusCode,
+                        (string) $request->getUri()
+                    ),
+                    $statusCode,
+                    $response->getHeaders(),
+                    (string) $response->getBody()
+                );
+            }
+
+            return $this->handleResponseWithDataType(
+                '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200Response',
+                $request,
+                $response,
+            );
+        } catch (ApiException $e) {
+            switch ($e->getCode()) {
+                case 200:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200Response',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+                case 422:
+                    $data = ObjectSerializer::deserialize(
+                        $e->getResponseBody(),
+                        '\WikipaliApi\Model\ProblemDetails',
+                        $e->getResponseHeaders()
+                    );
+                    $e->setResponseObject($data);
+                    throw $e;
+            }
+        
+
+            throw $e;
+        }
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAggregateAsync
+     *
+     * 按书统计命中
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaWordParagraphsAggregateAsync($words, $bold = null, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'][0])
+    {
+        return $this->getApiV3TipitakaWordParagraphsAggregateAsyncWithHttpInfo($words, $bold, $contentType)
+            ->then(
+                function ($response) {
+                    return $response[0];
+                }
+            );
+    }
+
+    /**
+     * Operation getApiV3TipitakaWordParagraphsAggregateAsyncWithHttpInfo
+     *
+     * 按书统计命中
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Promise\PromiseInterface
+     */
+    public function getApiV3TipitakaWordParagraphsAggregateAsyncWithHttpInfo($words, $bold = null, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'][0])
+    {
+        $returnType = '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200Response';
+        $request = $this->getApiV3TipitakaWordParagraphsAggregateRequest($words, $bold, $contentType);
+
+        return $this->client
+            ->sendAsync($request, $this->createHttpClientOption())
+            ->then(
+                function ($response) use ($returnType) {
+                    if ($returnType === '\SplFileObject') {
+                        $content = $response->getBody(); //stream goes to serializer
+                    } else {
+                        $content = (string) $response->getBody();
+                        if ($returnType !== 'string') {
+                            $content = json_decode($content);
+                        }
+                    }
+
+                    return [
+                        ObjectSerializer::deserialize($content, $returnType, []),
+                        $response->getStatusCode(),
+                        $response->getHeaders()
+                    ];
+                },
+                function ($exception) {
+                    $response = $exception->getResponse();
+                    $statusCode = $response->getStatusCode();
+                    throw new ApiException(
+                        sprintf(
+                            '[%d] Error connecting to the API (%s)',
+                            $statusCode,
+                            $exception->getRequest()->getUri()
+                        ),
+                        $statusCode,
+                        $response->getHeaders(),
+                        (string) $response->getBody()
+                    );
+                }
+            );
+    }
+
+    /**
+     * Create request for operation 'getApiV3TipitakaWordParagraphsAggregate'
+     *
+     * @param  string $words 词形,逗号分隔,最多 200 个 (required)
+     * @param  string|null $bold 只看黑体(only)或排除黑体(exclude);不给则不限 (optional)
+     * @param  string $contentType The value for the Content-Type header. Check self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'] to see the possible values for this operation
+     *
+     * @throws \InvalidArgumentException
+     * @return \GuzzleHttp\Psr7\Request
+     */
+    public function getApiV3TipitakaWordParagraphsAggregateRequest($words, $bold = null, string $contentType = self::contentTypes['getApiV3TipitakaWordParagraphsAggregate'][0])
+    {
+
+        // verify the required parameter 'words' is set
+        if ($words === null || (is_array($words) && count($words) === 0)) {
+            throw new \InvalidArgumentException(
+                'Missing the required parameter $words when calling getApiV3TipitakaWordParagraphsAggregate'
+            );
+        }
+
+
+
+        $resourcePath = '/v3/tipitaka-word-paragraphs/aggregate';
+        $formParams = [];
+        $queryParams = [];
+        $headerParams = [];
+        $httpBody = '';
+        $multipart = false;
+
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $words,
+            'words', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            true // required
+        ) ?? []);
+        // query params
+        $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+            $bold,
+            'bold', // param base name
+            'string', // openApiType
+            'form', // style
+            true, // explode
+            false // required
+        ) ?? []);
+
+
+
+
+        $headers = $this->headerSelector->selectHeaders(
+            ['application/json', 'application/problem+json', ],
+            $contentType,
+            $multipart
+        );
+
+        // for model (json/xml)
+        if (count($formParams) > 0) {
+            if ($multipart) {
+                $multipartContents = [];
+                foreach ($formParams as $formParamName => $formParamValue) {
+                    $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+                    foreach ($formParamValueItems as $formParamValueItem) {
+                        $multipartContents[] = [
+                            'name' => $formParamName,
+                            'contents' => $formParamValueItem
+                        ];
+                    }
+                }
+                // for HTTP post (form)
+                $httpBody = new MultipartStream($multipartContents);
+
+            } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+                # if Content-Type contains "application/json", json_encode the form parameters
+                try {
+                    $httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $e) {
+                    throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
+                }
+            } else {
+                // for HTTP post (form)
+                $httpBody = ObjectSerializer::buildQuery($formParams);
+            }
+        }
+
+        // this endpoint requires Bearer authentication (access token)
+        if (!empty($this->config->getAccessToken())) {
+            $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
+        }
+
+        $defaultHeaders = [];
+        if ($this->config->getUserAgent()) {
+            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+        }
+
+        $headers = array_merge(
+            $defaultHeaders,
+            $headerParams,
+            $headers
+        );
+
+        $operationHost = $this->config->getHost();
+        $query = ObjectSerializer::buildQuery($queryParams);
+        return new Request(
+            'GET',
+            $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+            $headers,
+            $httpBody
+        );
+    }
+
+    /**
+     * Create http client option
+     *
+     * @throws \RuntimeException on file opening failure
+     * @return array of http client options
+     */
+    protected function createHttpClientOption()
+    {
+        $options = [];
+        if ($this->config->getDebug()) {
+            $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
+            if (!$options[RequestOptions::DEBUG]) {
+                throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
+            }
+        }
+
+        if ($this->config->getCertFile()) {
+            $options[RequestOptions::CERT] = $this->config->getCertFile();
+        }
+
+        if ($this->config->getKeyFile()) {
+            $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile();
+        }
+
+        return $options;
+    }
+
+    private function handleResponseWithDataType(
+        string $dataType,
+        RequestInterface $request,
+        ResponseInterface $response
+    ): array {
+        if ($dataType === '\SplFileObject') {
+            $content = $response->getBody(); //stream goes to serializer
+        } else {
+            $content = (string) $response->getBody();
+            if ($dataType !== 'string') {
+                try {
+                    $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
+                } catch (\JsonException $exception) {
+                    throw new ApiException(
+                        sprintf(
+                            'Error JSON decoding server response (%s)',
+                            $request->getUri()
+                        ),
+                        $response->getStatusCode(),
+                        $response->getHeaders(),
+                        $content
+                    );
+                }
+            }
+        }
+
+        return [
+            ObjectSerializer::deserialize($content, $dataType, []),
+            $response->getStatusCode(),
+            $response->getHeaders()
+        ];
+    }
+
+    private function responseWithinRangeCode(
+        string $rangeCode,
+        int $statusCode
+    ): bool {
+        $left = (int) ($rangeCode[0].'00');
+        $right = (int) ($rangeCode[0].'99');
+
+        return $statusCode >= $left && $statusCode <= $right;
+    }
+}

+ 6 - 6
api-test/client/lib/Api/UpgradeApi.php

@@ -134,7 +134,7 @@ class UpgradeApi
      *
      * @throws \WikipaliApi\ApiException on non-2xx response or if the response body is not in the expected format
      * @throws \InvalidArgumentException
-     * @return \WikipaliApi\Model\GetApiV3SearchSearch200Response
+     * @return \WikipaliApi\Model\GetApiV3Upgrade200Response
      */
     public function getApiV3Upgrade(string $contentType = self::contentTypes['getApiV3Upgrade'][0])
     {
@@ -151,7 +151,7 @@ class UpgradeApi
      *
      * @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\GetApiV3SearchSearch200Response, HTTP status code, HTTP response headers (array of strings)
+     * @return array of \WikipaliApi\Model\GetApiV3Upgrade200Response, HTTP status code, HTTP response headers (array of strings)
      */
     public function getApiV3UpgradeWithHttpInfo(string $contentType = self::contentTypes['getApiV3Upgrade'][0])
     {
@@ -183,7 +183,7 @@ class UpgradeApi
             switch($statusCode) {
                 case 200:
                     return $this->handleResponseWithDataType(
-                        '\WikipaliApi\Model\GetApiV3SearchSearch200Response',
+                        '\WikipaliApi\Model\GetApiV3Upgrade200Response',
                         $request,
                         $response,
                     );
@@ -205,7 +205,7 @@ class UpgradeApi
             }
 
             return $this->handleResponseWithDataType(
-                '\WikipaliApi\Model\GetApiV3SearchSearch200Response',
+                '\WikipaliApi\Model\GetApiV3Upgrade200Response',
                 $request,
                 $response,
             );
@@ -214,7 +214,7 @@ class UpgradeApi
                 case 200:
                     $data = ObjectSerializer::deserialize(
                         $e->getResponseBody(),
-                        '\WikipaliApi\Model\GetApiV3SearchSearch200Response',
+                        '\WikipaliApi\Model\GetApiV3Upgrade200Response',
                         $e->getResponseHeaders()
                     );
                     $e->setResponseObject($data);
@@ -258,7 +258,7 @@ class UpgradeApi
      */
     public function getApiV3UpgradeAsyncWithHttpInfo(string $contentType = self::contentTypes['getApiV3Upgrade'][0])
     {
-        $returnType = '\WikipaliApi\Model\GetApiV3SearchSearch200Response';
+        $returnType = '\WikipaliApi\Model\GetApiV3Upgrade200Response';
         $request = $this->getApiV3UpgradeRequest($contentType);
 
         return $this->client

+ 409 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseData'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseData|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseData|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 518 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseData.php

@@ -0,0 +1,518 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseData
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseData Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseData implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'ending' => 'string',
+        'lang' => 'string',
+        'term' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataTerm',
+        'relations' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInner[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'ending' => null,
+        'lang' => null,
+        'term' => null,
+        'relations' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'ending' => false,
+        'lang' => false,
+        'term' => true,
+        'relations' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'ending' => 'ending',
+        'lang' => 'lang',
+        'term' => 'term',
+        'relations' => 'relations'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'ending' => 'setEnding',
+        'lang' => 'setLang',
+        'term' => 'setTerm',
+        'relations' => 'setRelations'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'ending' => 'getEnding',
+        'lang' => 'getLang',
+        'term' => 'getTerm',
+        'relations' => 'getRelations'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('ending', $data ?? [], null);
+        $this->setIfExists('lang', $data ?? [], null);
+        $this->setIfExists('term', $data ?? [], null);
+        $this->setIfExists('relations', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets ending
+     *
+     * @return string|null
+     */
+    public function getEnding()
+    {
+        return $this->container['ending'];
+    }
+
+    /**
+     * Sets ending
+     *
+     * @param string|null $ending ending
+     *
+     * @return self
+     */
+    public function setEnding($ending)
+    {
+        if (is_null($ending)) {
+            throw new \InvalidArgumentException('non-nullable ending cannot be null');
+        }
+        $this->container['ending'] = $ending;
+
+        return $this;
+    }
+
+    /**
+     * Gets lang
+     *
+     * @return string|null
+     */
+    public function getLang()
+    {
+        return $this->container['lang'];
+    }
+
+    /**
+     * Sets lang
+     *
+     * @param string|null $lang lang
+     *
+     * @return self
+     */
+    public function setLang($lang)
+    {
+        if (is_null($lang)) {
+            throw new \InvalidArgumentException('non-nullable lang cannot be null');
+        }
+        $this->container['lang'] = $lang;
+
+        return $this;
+    }
+
+    /**
+     * Gets term
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataTerm|null
+     */
+    public function getTerm()
+    {
+        return $this->container['term'];
+    }
+
+    /**
+     * Sets term
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataTerm|null $term term
+     *
+     * @return self
+     */
+    public function setTerm($term)
+    {
+        if (is_null($term)) {
+            array_push($this->openAPINullablesSetToNull, 'term');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('term', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['term'] = $term;
+
+        return $this;
+    }
+
+    /**
+     * Gets relations
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInner[]|null
+     */
+    public function getRelations()
+    {
+        return $this->container['relations'];
+    }
+
+    /**
+     * Sets relations
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInner[]|null $relations relations
+     *
+     * @return self
+     */
+    public function setRelations($relations)
+    {
+        if (is_null($relations)) {
+            throw new \InvalidArgumentException('non-nullable relations cannot be null');
+        }
+        $this->container['relations'] = $relations;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 607 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInner.php

@@ -0,0 +1,607 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseDataRelationsInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data_relations_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'relation' => 'string',
+        'relation_label' => 'string',
+        'from' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom',
+        'to' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom',
+        'category' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory',
+        'local_endings' => 'string[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'relation' => null,
+        'relation_label' => null,
+        'from' => null,
+        'to' => null,
+        'category' => null,
+        'local_endings' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'relation' => false,
+        'relation_label' => true,
+        'from' => true,
+        'to' => true,
+        'category' => true,
+        'local_endings' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'relation' => 'relation',
+        'relation_label' => 'relation_label',
+        'from' => 'from',
+        'to' => 'to',
+        'category' => 'category',
+        'local_endings' => 'local_endings'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'relation' => 'setRelation',
+        'relation_label' => 'setRelationLabel',
+        'from' => 'setFrom',
+        'to' => 'setTo',
+        'category' => 'setCategory',
+        'local_endings' => 'setLocalEndings'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'relation' => 'getRelation',
+        'relation_label' => 'getRelationLabel',
+        'from' => 'getFrom',
+        'to' => 'getTo',
+        'category' => 'getCategory',
+        'local_endings' => 'getLocalEndings'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('relation', $data ?? [], null);
+        $this->setIfExists('relation_label', $data ?? [], null);
+        $this->setIfExists('from', $data ?? [], null);
+        $this->setIfExists('to', $data ?? [], null);
+        $this->setIfExists('category', $data ?? [], null);
+        $this->setIfExists('local_endings', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets relation
+     *
+     * @return string|null
+     */
+    public function getRelation()
+    {
+        return $this->container['relation'];
+    }
+
+    /**
+     * Sets relation
+     *
+     * @param string|null $relation relation
+     *
+     * @return self
+     */
+    public function setRelation($relation)
+    {
+        if (is_null($relation)) {
+            throw new \InvalidArgumentException('non-nullable relation cannot be null');
+        }
+        $this->container['relation'] = $relation;
+
+        return $this;
+    }
+
+    /**
+     * Gets relation_label
+     *
+     * @return string|null
+     */
+    public function getRelationLabel()
+    {
+        return $this->container['relation_label'];
+    }
+
+    /**
+     * Sets relation_label
+     *
+     * @param string|null $relation_label relation_label
+     *
+     * @return self
+     */
+    public function setRelationLabel($relation_label)
+    {
+        if (is_null($relation_label)) {
+            array_push($this->openAPINullablesSetToNull, 'relation_label');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('relation_label', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['relation_label'] = $relation_label;
+
+        return $this;
+    }
+
+    /**
+     * Gets from
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom|null
+     */
+    public function getFrom()
+    {
+        return $this->container['from'];
+    }
+
+    /**
+     * Sets from
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom|null $from from
+     *
+     * @return self
+     */
+    public function setFrom($from)
+    {
+        if (is_null($from)) {
+            array_push($this->openAPINullablesSetToNull, 'from');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('from', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['from'] = $from;
+
+        return $this;
+    }
+
+    /**
+     * Gets to
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom|null
+     */
+    public function getTo()
+    {
+        return $this->container['to'];
+    }
+
+    /**
+     * Sets to
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom|null $to to
+     *
+     * @return self
+     */
+    public function setTo($to)
+    {
+        if (is_null($to)) {
+            array_push($this->openAPINullablesSetToNull, 'to');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('to', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['to'] = $to;
+
+        return $this;
+    }
+
+    /**
+     * Gets category
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory|null
+     */
+    public function getCategory()
+    {
+        return $this->container['category'];
+    }
+
+    /**
+     * Sets category
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory|null $category category
+     *
+     * @return self
+     */
+    public function setCategory($category)
+    {
+        if (is_null($category)) {
+            array_push($this->openAPINullablesSetToNull, 'category');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('category', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['category'] = $category;
+
+        return $this;
+    }
+
+    /**
+     * Gets local_endings
+     *
+     * @return string[]|null
+     */
+    public function getLocalEndings()
+    {
+        return $this->container['local_endings'];
+    }
+
+    /**
+     * Sets local_endings
+     *
+     * @param string[]|null $local_endings local_endings
+     *
+     * @return self
+     */
+    public function setLocalEndings($local_endings)
+    {
+        if (is_null($local_endings)) {
+            throw new \InvalidArgumentException('non-nullable local_endings cannot be null');
+        }
+        $this->container['local_endings'] = $local_endings;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 477 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory.php

@@ -0,0 +1,477 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerCategory implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data_relations_inner_category';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'name' => 'string',
+        'meaning' => 'string',
+        'note' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'name' => null,
+        'meaning' => null,
+        'note' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'name' => false,
+        'meaning' => false,
+        'note' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'name' => 'name',
+        'meaning' => 'meaning',
+        'note' => 'note'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'name' => 'setName',
+        'meaning' => 'setMeaning',
+        'note' => 'setNote'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'name' => 'getName',
+        'meaning' => 'getMeaning',
+        'note' => 'getNote'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('name', $data ?? [], null);
+        $this->setIfExists('meaning', $data ?? [], null);
+        $this->setIfExists('note', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets name
+     *
+     * @return string|null
+     */
+    public function getName()
+    {
+        return $this->container['name'];
+    }
+
+    /**
+     * Sets name
+     *
+     * @param string|null $name name
+     *
+     * @return self
+     */
+    public function setName($name)
+    {
+        if (is_null($name)) {
+            throw new \InvalidArgumentException('non-nullable name cannot be null');
+        }
+        $this->container['name'] = $name;
+
+        return $this;
+    }
+
+    /**
+     * Gets meaning
+     *
+     * @return string|null
+     */
+    public function getMeaning()
+    {
+        return $this->container['meaning'];
+    }
+
+    /**
+     * Sets meaning
+     *
+     * @param string|null $meaning meaning
+     *
+     * @return self
+     */
+    public function setMeaning($meaning)
+    {
+        if (is_null($meaning)) {
+            throw new \InvalidArgumentException('non-nullable meaning cannot be null');
+        }
+        $this->container['meaning'] = $meaning;
+
+        return $this;
+    }
+
+    /**
+     * Gets note
+     *
+     * @return string|null
+     */
+    public function getNote()
+    {
+        return $this->container['note'];
+    }
+
+    /**
+     * Sets note
+     *
+     * @param string|null $note note
+     *
+     * @return self
+     */
+    public function setNote($note)
+    {
+        if (is_null($note)) {
+            throw new \InvalidArgumentException('non-nullable note cannot be null');
+        }
+        $this->container['note'] = $note;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFrom implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data_relations_inner_from';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'cases' => '\WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner[]',
+        'spell' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'cases' => null,
+        'spell' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'cases' => false,
+        'spell' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'cases' => 'cases',
+        'spell' => 'spell'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'cases' => 'setCases',
+        'spell' => 'setSpell'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'cases' => 'getCases',
+        'spell' => 'getSpell'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('cases', $data ?? [], null);
+        $this->setIfExists('spell', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets cases
+     *
+     * @return \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner[]|null
+     */
+    public function getCases()
+    {
+        return $this->container['cases'];
+    }
+
+    /**
+     * Sets cases
+     *
+     * @param \WikipaliApi\Model\GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner[]|null $cases cases
+     *
+     * @return self
+     */
+    public function setCases($cases)
+    {
+        if (is_null($cases)) {
+            throw new \InvalidArgumentException('non-nullable cases cannot be null');
+        }
+        $this->container['cases'] = $cases;
+
+        return $this;
+    }
+
+    /**
+     * Gets spell
+     *
+     * @return string|null
+     */
+    public function getSpell()
+    {
+        return $this->container['spell'];
+    }
+
+    /**
+     * Sets spell
+     *
+     * @param string|null $spell spell
+     *
+     * @return self
+     */
+    public function setSpell($spell)
+    {
+        if (is_null($spell)) {
+            throw new \InvalidArgumentException('non-nullable spell cannot be null');
+        }
+        $this->container['spell'] = $spell;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseDataRelationsInnerFromCasesInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data_relations_inner_from_cases_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'case' => 'string',
+        'label' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'case' => null,
+        'label' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'case' => false,
+        'label' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'case' => 'case',
+        'label' => 'label'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'case' => 'setCase',
+        'label' => 'setLabel'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'case' => 'getCase',
+        'label' => 'getLabel'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('case', $data ?? [], null);
+        $this->setIfExists('label', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets case
+     *
+     * @return string|null
+     */
+    public function getCase()
+    {
+        return $this->container['case'];
+    }
+
+    /**
+     * Sets case
+     *
+     * @param string|null $case case
+     *
+     * @return self
+     */
+    public function setCase($case)
+    {
+        if (is_null($case)) {
+            throw new \InvalidArgumentException('non-nullable case cannot be null');
+        }
+        $this->container['case'] = $case;
+
+        return $this;
+    }
+
+    /**
+     * Gets label
+     *
+     * @return string|null
+     */
+    public function getLabel()
+    {
+        return $this->container['label'];
+    }
+
+    /**
+     * Sets label
+     *
+     * @param string|null $label label
+     *
+     * @return self
+     */
+    public function setLabel($label)
+    {
+        if (is_null($label)) {
+            throw new \InvalidArgumentException('non-nullable label cannot be null');
+        }
+        $this->container['label'] = $label;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 545 - 0
api-test/client/lib/Model/GetApiV3NissayaCardsEnding200ResponseDataTerm.php

@@ -0,0 +1,545 @@
+<?php
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataTerm
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3NissayaCardsEnding200ResponseDataTerm Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3NissayaCardsEnding200ResponseDataTerm implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_nissaya_cards_ending__200_response_data_term';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'word' => 'string',
+        'tag' => 'string',
+        'meaning' => 'string',
+        'body' => '\WikipaliApi\Model\MarkupNode[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'word' => null,
+        'tag' => null,
+        'meaning' => null,
+        'body' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'word' => false,
+        'tag' => false,
+        'meaning' => false,
+        'body' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'word' => 'word',
+        'tag' => 'tag',
+        'meaning' => 'meaning',
+        'body' => 'body'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'word' => 'setWord',
+        'tag' => 'setTag',
+        'meaning' => 'setMeaning',
+        'body' => 'setBody'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'word' => 'getWord',
+        'tag' => 'getTag',
+        'meaning' => 'getMeaning',
+        'body' => 'getBody'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('word', $data ?? [], null);
+        $this->setIfExists('tag', $data ?? [], null);
+        $this->setIfExists('meaning', $data ?? [], null);
+        $this->setIfExists('body', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets word
+     *
+     * @return string|null
+     */
+    public function getWord()
+    {
+        return $this->container['word'];
+    }
+
+    /**
+     * Sets word
+     *
+     * @param string|null $word word
+     *
+     * @return self
+     */
+    public function setWord($word)
+    {
+        if (is_null($word)) {
+            throw new \InvalidArgumentException('non-nullable word cannot be null');
+        }
+        $this->container['word'] = $word;
+
+        return $this;
+    }
+
+    /**
+     * Gets tag
+     *
+     * @return string|null
+     */
+    public function getTag()
+    {
+        return $this->container['tag'];
+    }
+
+    /**
+     * Sets tag
+     *
+     * @param string|null $tag tag
+     *
+     * @return self
+     */
+    public function setTag($tag)
+    {
+        if (is_null($tag)) {
+            throw new \InvalidArgumentException('non-nullable tag cannot be null');
+        }
+        $this->container['tag'] = $tag;
+
+        return $this;
+    }
+
+    /**
+     * Gets meaning
+     *
+     * @return string|null
+     */
+    public function getMeaning()
+    {
+        return $this->container['meaning'];
+    }
+
+    /**
+     * Sets meaning
+     *
+     * @param string|null $meaning meaning
+     *
+     * @return self
+     */
+    public function setMeaning($meaning)
+    {
+        if (is_null($meaning)) {
+            throw new \InvalidArgumentException('non-nullable meaning cannot be null');
+        }
+        $this->container['meaning'] = $meaning;
+
+        return $this;
+    }
+
+    /**
+     * Gets body
+     *
+     * @return \WikipaliApi\Model\MarkupNode[]|null
+     */
+    public function getBody()
+    {
+        return $this->container['body'];
+    }
+
+    /**
+     * Sets body
+     *
+     * @param \WikipaliApi\Model\MarkupNode[]|null $body body
+     *
+     * @return self
+     */
+    public function setBody($body)
+    {
+        if (is_null($body)) {
+            throw new \InvalidArgumentException('non-nullable body cannot be null');
+        }
+        $this->container['body'] = $body;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3PaliWordFormsWord200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3PaliWordFormsWord200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordFormsWord200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordFormsWord200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_forms_word__200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInner.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3PaliWordFormsWord200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordFormsWord200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordFormsWord200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_forms_word__200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'base' => 'string',
+        'forms' => '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'base' => null,
+        'forms' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'base' => false,
+        'forms' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'base' => 'base',
+        'forms' => 'forms'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'base' => 'setBase',
+        'forms' => 'setForms'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'base' => 'getBase',
+        'forms' => 'getForms'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('base', $data ?? [], null);
+        $this->setIfExists('forms', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets base
+     *
+     * @return string|null
+     */
+    public function getBase()
+    {
+        return $this->container['base'];
+    }
+
+    /**
+     * Sets base
+     *
+     * @param string|null $base base
+     *
+     * @return self
+     */
+    public function setBase($base)
+    {
+        if (is_null($base)) {
+            throw new \InvalidArgumentException('non-nullable base cannot be null');
+        }
+        $this->container['base'] = $base;
+
+        return $this;
+    }
+
+    /**
+     * Gets forms
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]|null
+     */
+    public function getForms()
+    {
+        return $this->container['forms'];
+    }
+
+    /**
+     * Sets forms
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]|null $forms forms
+     *
+     * @return self
+     */
+    public function setForms($forms)
+    {
+        if (is_null($forms)) {
+            throw new \InvalidArgumentException('non-nullable forms cannot be null');
+        }
+        $this->container['forms'] = $forms;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 477 - 0
api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner.php

@@ -0,0 +1,477 @@
+<?php
+/**
+ * GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_forms_word__200_response_data_inner_forms_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'word' => 'string',
+        'count' => 'int',
+        'bold' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'word' => null,
+        'count' => null,
+        'bold' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'word' => false,
+        'count' => false,
+        'bold' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'word' => 'word',
+        'count' => 'count',
+        'bold' => 'bold'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'word' => 'setWord',
+        'count' => 'setCount',
+        'bold' => 'setBold'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'word' => 'getWord',
+        'count' => 'getCount',
+        'bold' => 'getBold'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('word', $data ?? [], null);
+        $this->setIfExists('count', $data ?? [], null);
+        $this->setIfExists('bold', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets word
+     *
+     * @return string|null
+     */
+    public function getWord()
+    {
+        return $this->container['word'];
+    }
+
+    /**
+     * Sets word
+     *
+     * @param string|null $word word
+     *
+     * @return self
+     */
+    public function setWord($word)
+    {
+        if (is_null($word)) {
+            throw new \InvalidArgumentException('non-nullable word cannot be null');
+        }
+        $this->container['word'] = $word;
+
+        return $this;
+    }
+
+    /**
+     * Gets count
+     *
+     * @return int|null
+     */
+    public function getCount()
+    {
+        return $this->container['count'];
+    }
+
+    /**
+     * Sets count
+     *
+     * @param int|null $count count
+     *
+     * @return self
+     */
+    public function setCount($count)
+    {
+        if (is_null($count)) {
+            throw new \InvalidArgumentException('non-nullable count cannot be null');
+        }
+        $this->container['count'] = $count;
+
+        return $this;
+    }
+
+    /**
+     * Gets bold
+     *
+     * @return int|null
+     */
+    public function getBold()
+    {
+        return $this->container['bold'];
+    }
+
+    /**
+     * Sets bold
+     *
+     * @param int|null $bold bold
+     *
+     * @return self
+     */
+    public function setBold($bold)
+    {
+        if (is_null($bold)) {
+            throw new \InvalidArgumentException('non-nullable bold cannot be null');
+        }
+        $this->container['bold'] = $bold;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/GetApiV3PaliWordFormsWord200ResponseMeta.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3PaliWordFormsWord200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordFormsWord200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordFormsWord200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_forms_word__200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'total' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'total' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'total' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'total' => 'total'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'total' => 'setTotal'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'total' => 'getTotal'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('total', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 组数
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3PaliWordSuggestions200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3PaliWordSuggestions200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordSuggestions200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordSuggestions200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_suggestions_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordFormsWord200ResponseDataInnerFormsInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/GetApiV3PaliWordSuggestions200ResponseMeta.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3PaliWordSuggestions200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3PaliWordSuggestions200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3PaliWordSuggestions200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_pali_word_suggestions_200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'total' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'total' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'total' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'total' => 'total'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'total' => 'setTotal'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'total' => 'getTotal'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('total', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 本次返回的条数
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 33 - 33
api-test/client/lib/Model/GetApiV3Search200Response.php

@@ -57,8 +57,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @var string[]
      */
     protected static $openAPITypes = [
-        'success' => 'bool',
-        'data' => 'object'
+        'data' => '\WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3Search200ResponseMeta'
     ];
 
     /**
@@ -69,8 +69,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @psalm-var array<string, string|null>
      */
     protected static $openAPIFormats = [
-        'success' => null,
-        'data' => null
+        'data' => null,
+        'meta' => null
     ];
 
     /**
@@ -79,8 +79,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @var boolean[]
      */
     protected static array $openAPINullables = [
-        'success' => false,
-        'data' => false
+        'data' => false,
+        'meta' => false
     ];
 
     /**
@@ -169,8 +169,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @var string[]
      */
     protected static $attributeMap = [
-        'success' => 'success',
-        'data' => 'data'
+        'data' => 'data',
+        'meta' => 'meta'
     ];
 
     /**
@@ -179,8 +179,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @var string[]
      */
     protected static $setters = [
-        'success' => 'setSuccess',
-        'data' => 'setData'
+        'data' => 'setData',
+        'meta' => 'setMeta'
     ];
 
     /**
@@ -189,8 +189,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      * @var string[]
      */
     protected static $getters = [
-        'success' => 'getSuccess',
-        'data' => 'getData'
+        'data' => 'getData',
+        'meta' => 'getMeta'
     ];
 
     /**
@@ -250,8 +250,8 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
      */
     public function __construct(?array $data = null)
     {
-        $this->setIfExists('success', $data ?? [], null);
         $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
     }
 
     /**
@@ -297,55 +297,55 @@ class GetApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSer
 
 
     /**
-     * Gets success
+     * Gets data
      *
-     * @return bool|null
+     * @return \WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]|null
      */
-    public function getSuccess()
+    public function getData()
     {
-        return $this->container['success'];
+        return $this->container['data'];
     }
 
     /**
-     * Sets success
+     * Sets data
      *
-     * @param bool|null $success success
+     * @param \WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]|null $data data
      *
      * @return self
      */
-    public function setSuccess($success)
+    public function setData($data)
     {
-        if (is_null($success)) {
-            throw new \InvalidArgumentException('non-nullable success cannot be null');
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
         }
-        $this->container['success'] = $success;
+        $this->container['data'] = $data;
 
         return $this;
     }
 
     /**
-     * Gets data
+     * Gets meta
      *
-     * @return object|null
+     * @return \WikipaliApi\Model\GetApiV3Search200ResponseMeta|null
      */
-    public function getData()
+    public function getMeta()
     {
-        return $this->container['data'];
+        return $this->container['meta'];
     }
 
     /**
-     * Sets data
+     * Sets meta
      *
-     * @param object|null $data data
+     * @param \WikipaliApi\Model\GetApiV3Search200ResponseMeta|null $meta meta
      *
      * @return self
      */
-    public function setData($data)
+    public function setMeta($meta)
     {
-        if (is_null($data)) {
-            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
         }
-        $this->container['data'] = $data;
+        $this->container['meta'] = $meta;
 
         return $this;
     }

+ 975 - 0
api-test/client/lib/Model/GetApiV3Search200ResponseDataInner.php

@@ -0,0 +1,975 @@
+<?php
+/**
+ * GetApiV3Search200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Search200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Search200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_search_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'resource_type' => 'string',
+        'resource_id' => 'string',
+        'granularity' => 'string',
+        'language' => 'string',
+        'related_id' => 'string',
+        'score' => 'float',
+        'title' => 'string',
+        'content' => 'string',
+        'highlight' => 'string',
+        'bold' => 'string[]',
+        'path' => 'string',
+        'category' => 'string[]',
+        'tags' => 'string[]',
+        'updated_at' => 'string',
+        'display' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'resource_type' => null,
+        'resource_id' => null,
+        'granularity' => null,
+        'language' => null,
+        'related_id' => null,
+        'score' => null,
+        'title' => null,
+        'content' => null,
+        'highlight' => null,
+        'bold' => null,
+        'path' => null,
+        'category' => null,
+        'tags' => null,
+        'updated_at' => null,
+        'display' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'resource_type' => false,
+        'resource_id' => true,
+        'granularity' => true,
+        'language' => true,
+        'related_id' => true,
+        'score' => true,
+        'title' => false,
+        'content' => false,
+        'highlight' => true,
+        'bold' => false,
+        'path' => true,
+        'category' => false,
+        'tags' => false,
+        'updated_at' => true,
+        'display' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'resource_type' => 'resource_type',
+        'resource_id' => 'resource_id',
+        'granularity' => 'granularity',
+        'language' => 'language',
+        'related_id' => 'related_id',
+        'score' => 'score',
+        'title' => 'title',
+        'content' => 'content',
+        'highlight' => 'highlight',
+        'bold' => 'bold',
+        'path' => 'path',
+        'category' => 'category',
+        'tags' => 'tags',
+        'updated_at' => 'updated_at',
+        'display' => 'display'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'resource_type' => 'setResourceType',
+        'resource_id' => 'setResourceId',
+        'granularity' => 'setGranularity',
+        'language' => 'setLanguage',
+        'related_id' => 'setRelatedId',
+        'score' => 'setScore',
+        'title' => 'setTitle',
+        'content' => 'setContent',
+        'highlight' => 'setHighlight',
+        'bold' => 'setBold',
+        'path' => 'setPath',
+        'category' => 'setCategory',
+        'tags' => 'setTags',
+        'updated_at' => 'setUpdatedAt',
+        'display' => 'setDisplay'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'resource_type' => 'getResourceType',
+        'resource_id' => 'getResourceId',
+        'granularity' => 'getGranularity',
+        'language' => 'getLanguage',
+        'related_id' => 'getRelatedId',
+        'score' => 'getScore',
+        'title' => 'getTitle',
+        'content' => 'getContent',
+        'highlight' => 'getHighlight',
+        'bold' => 'getBold',
+        'path' => 'getPath',
+        'category' => 'getCategory',
+        'tags' => 'getTags',
+        'updated_at' => 'getUpdatedAt',
+        'display' => 'getDisplay'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('resource_type', $data ?? [], null);
+        $this->setIfExists('resource_id', $data ?? [], null);
+        $this->setIfExists('granularity', $data ?? [], null);
+        $this->setIfExists('language', $data ?? [], null);
+        $this->setIfExists('related_id', $data ?? [], null);
+        $this->setIfExists('score', $data ?? [], null);
+        $this->setIfExists('title', $data ?? [], null);
+        $this->setIfExists('content', $data ?? [], null);
+        $this->setIfExists('highlight', $data ?? [], null);
+        $this->setIfExists('bold', $data ?? [], null);
+        $this->setIfExists('path', $data ?? [], null);
+        $this->setIfExists('category', $data ?? [], null);
+        $this->setIfExists('tags', $data ?? [], null);
+        $this->setIfExists('updated_at', $data ?? [], null);
+        $this->setIfExists('display', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets resource_type
+     *
+     * @return string|null
+     */
+    public function getResourceType()
+    {
+        return $this->container['resource_type'];
+    }
+
+    /**
+     * Sets resource_type
+     *
+     * @param string|null $resource_type resource_type
+     *
+     * @return self
+     */
+    public function setResourceType($resource_type)
+    {
+        if (is_null($resource_type)) {
+            throw new \InvalidArgumentException('non-nullable resource_type cannot be null');
+        }
+        $this->container['resource_type'] = $resource_type;
+
+        return $this;
+    }
+
+    /**
+     * Gets resource_id
+     *
+     * @return string|null
+     */
+    public function getResourceId()
+    {
+        return $this->container['resource_id'];
+    }
+
+    /**
+     * Sets resource_id
+     *
+     * @param string|null $resource_id resource_id
+     *
+     * @return self
+     */
+    public function setResourceId($resource_id)
+    {
+        if (is_null($resource_id)) {
+            array_push($this->openAPINullablesSetToNull, 'resource_id');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('resource_id', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['resource_id'] = $resource_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets granularity
+     *
+     * @return string|null
+     */
+    public function getGranularity()
+    {
+        return $this->container['granularity'];
+    }
+
+    /**
+     * Sets granularity
+     *
+     * @param string|null $granularity granularity
+     *
+     * @return self
+     */
+    public function setGranularity($granularity)
+    {
+        if (is_null($granularity)) {
+            array_push($this->openAPINullablesSetToNull, 'granularity');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('granularity', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['granularity'] = $granularity;
+
+        return $this;
+    }
+
+    /**
+     * Gets language
+     *
+     * @return string|null
+     */
+    public function getLanguage()
+    {
+        return $this->container['language'];
+    }
+
+    /**
+     * Sets language
+     *
+     * @param string|null $language language
+     *
+     * @return self
+     */
+    public function setLanguage($language)
+    {
+        if (is_null($language)) {
+            array_push($this->openAPINullablesSetToNull, 'language');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('language', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['language'] = $language;
+
+        return $this;
+    }
+
+    /**
+     * Gets related_id
+     *
+     * @return string|null
+     */
+    public function getRelatedId()
+    {
+        return $this->container['related_id'];
+    }
+
+    /**
+     * Sets related_id
+     *
+     * @param string|null $related_id related_id
+     *
+     * @return self
+     */
+    public function setRelatedId($related_id)
+    {
+        if (is_null($related_id)) {
+            array_push($this->openAPINullablesSetToNull, 'related_id');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('related_id', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['related_id'] = $related_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets score
+     *
+     * @return float|null
+     */
+    public function getScore()
+    {
+        return $this->container['score'];
+    }
+
+    /**
+     * Sets score
+     *
+     * @param float|null $score score
+     *
+     * @return self
+     */
+    public function setScore($score)
+    {
+        if (is_null($score)) {
+            array_push($this->openAPINullablesSetToNull, 'score');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('score', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['score'] = $score;
+
+        return $this;
+    }
+
+    /**
+     * Gets title
+     *
+     * @return string|null
+     */
+    public function getTitle()
+    {
+        return $this->container['title'];
+    }
+
+    /**
+     * Sets title
+     *
+     * @param string|null $title title
+     *
+     * @return self
+     */
+    public function setTitle($title)
+    {
+        if (is_null($title)) {
+            throw new \InvalidArgumentException('non-nullable title cannot be null');
+        }
+        $this->container['title'] = $title;
+
+        return $this;
+    }
+
+    /**
+     * Gets content
+     *
+     * @return string|null
+     */
+    public function getContent()
+    {
+        return $this->container['content'];
+    }
+
+    /**
+     * Sets content
+     *
+     * @param string|null $content content
+     *
+     * @return self
+     */
+    public function setContent($content)
+    {
+        if (is_null($content)) {
+            throw new \InvalidArgumentException('non-nullable content cannot be null');
+        }
+        $this->container['content'] = $content;
+
+        return $this;
+    }
+
+    /**
+     * Gets highlight
+     *
+     * @return string|null
+     */
+    public function getHighlight()
+    {
+        return $this->container['highlight'];
+    }
+
+    /**
+     * Sets highlight
+     *
+     * @param string|null $highlight highlight
+     *
+     * @return self
+     */
+    public function setHighlight($highlight)
+    {
+        if (is_null($highlight)) {
+            array_push($this->openAPINullablesSetToNull, 'highlight');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('highlight', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['highlight'] = $highlight;
+
+        return $this;
+    }
+
+    /**
+     * Gets bold
+     *
+     * @return string[]|null
+     */
+    public function getBold()
+    {
+        return $this->container['bold'];
+    }
+
+    /**
+     * Sets bold
+     *
+     * @param string[]|null $bold bold
+     *
+     * @return self
+     */
+    public function setBold($bold)
+    {
+        if (is_null($bold)) {
+            throw new \InvalidArgumentException('non-nullable bold cannot be null');
+        }
+        $this->container['bold'] = $bold;
+
+        return $this;
+    }
+
+    /**
+     * Gets path
+     *
+     * @return string|null
+     */
+    public function getPath()
+    {
+        return $this->container['path'];
+    }
+
+    /**
+     * Sets path
+     *
+     * @param string|null $path path
+     *
+     * @return self
+     */
+    public function setPath($path)
+    {
+        if (is_null($path)) {
+            array_push($this->openAPINullablesSetToNull, 'path');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('path', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['path'] = $path;
+
+        return $this;
+    }
+
+    /**
+     * Gets category
+     *
+     * @return string[]|null
+     */
+    public function getCategory()
+    {
+        return $this->container['category'];
+    }
+
+    /**
+     * Sets category
+     *
+     * @param string[]|null $category category
+     *
+     * @return self
+     */
+    public function setCategory($category)
+    {
+        if (is_null($category)) {
+            throw new \InvalidArgumentException('non-nullable category cannot be null');
+        }
+        $this->container['category'] = $category;
+
+        return $this;
+    }
+
+    /**
+     * Gets tags
+     *
+     * @return string[]|null
+     */
+    public function getTags()
+    {
+        return $this->container['tags'];
+    }
+
+    /**
+     * Sets tags
+     *
+     * @param string[]|null $tags tags
+     *
+     * @return self
+     */
+    public function setTags($tags)
+    {
+        if (is_null($tags)) {
+            throw new \InvalidArgumentException('non-nullable tags cannot be null');
+        }
+        $this->container['tags'] = $tags;
+
+        return $this;
+    }
+
+    /**
+     * Gets updated_at
+     *
+     * @return string|null
+     */
+    public function getUpdatedAt()
+    {
+        return $this->container['updated_at'];
+    }
+
+    /**
+     * Sets updated_at
+     *
+     * @param string|null $updated_at updated_at
+     *
+     * @return self
+     */
+    public function setUpdatedAt($updated_at)
+    {
+        if (is_null($updated_at)) {
+            array_push($this->openAPINullablesSetToNull, 'updated_at');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('updated_at', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['updated_at'] = $updated_at;
+
+        return $this;
+    }
+
+    /**
+     * Gets display
+     *
+     * @return string|null
+     */
+    public function getDisplay()
+    {
+        return $this->container['display'];
+    }
+
+    /**
+     * Sets display
+     *
+     * @param string|null $display 仅在部分查询口径下返回。
+     *
+     * @return self
+     */
+    public function setDisplay($display)
+    {
+        if (is_null($display)) {
+            throw new \InvalidArgumentException('non-nullable display cannot be null');
+        }
+        $this->container['display'] = $display;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 579 - 0
api-test/client/lib/Model/GetApiV3Search200ResponseMeta.php

@@ -0,0 +1,579 @@
+<?php
+/**
+ * GetApiV3Search200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Search200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Search200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_search_200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'current_page' => 'int',
+        'per_page' => 'int',
+        'total' => 'int',
+        'total_relation' => 'string',
+        'last_page' => 'int',
+        'facets' => 'array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'current_page' => null,
+        'per_page' => null,
+        'total' => null,
+        'total_relation' => null,
+        'last_page' => null,
+        'facets' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'current_page' => false,
+        'per_page' => false,
+        'total' => false,
+        'total_relation' => false,
+        'last_page' => false,
+        'facets' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'current_page' => 'current_page',
+        'per_page' => 'per_page',
+        'total' => 'total',
+        'total_relation' => 'total_relation',
+        'last_page' => 'last_page',
+        'facets' => 'facets'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'current_page' => 'setCurrentPage',
+        'per_page' => 'setPerPage',
+        'total' => 'setTotal',
+        'total_relation' => 'setTotalRelation',
+        'last_page' => 'setLastPage',
+        'facets' => 'setFacets'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'current_page' => 'getCurrentPage',
+        'per_page' => 'getPerPage',
+        'total' => 'getTotal',
+        'total_relation' => 'getTotalRelation',
+        'last_page' => 'getLastPage',
+        'facets' => 'getFacets'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('current_page', $data ?? [], null);
+        $this->setIfExists('per_page', $data ?? [], null);
+        $this->setIfExists('total', $data ?? [], null);
+        $this->setIfExists('total_relation', $data ?? [], null);
+        $this->setIfExists('last_page', $data ?? [], null);
+        $this->setIfExists('facets', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets current_page
+     *
+     * @return int|null
+     */
+    public function getCurrentPage()
+    {
+        return $this->container['current_page'];
+    }
+
+    /**
+     * Sets current_page
+     *
+     * @param int|null $current_page 当前页
+     *
+     * @return self
+     */
+    public function setCurrentPage($current_page)
+    {
+        if (is_null($current_page)) {
+            throw new \InvalidArgumentException('non-nullable current_page cannot be null');
+        }
+        $this->container['current_page'] = $current_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets per_page
+     *
+     * @return int|null
+     */
+    public function getPerPage()
+    {
+        return $this->container['per_page'];
+    }
+
+    /**
+     * Sets per_page
+     *
+     * @param int|null $per_page 每页条数
+     *
+     * @return self
+     */
+    public function setPerPage($per_page)
+    {
+        if (is_null($per_page)) {
+            throw new \InvalidArgumentException('non-nullable per_page cannot be null');
+        }
+        $this->container['per_page'] = $per_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 命中总数(total_relation 为 gte 时是下限)
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+
+    /**
+     * Gets total_relation
+     *
+     * @return string|null
+     */
+    public function getTotalRelation()
+    {
+        return $this->container['total_relation'];
+    }
+
+    /**
+     * Sets total_relation
+     *
+     * @param string|null $total_relation eq 精确,gte 表示「至少这么多」(OpenSearch 只精确计数到 10000)
+     *
+     * @return self
+     */
+    public function setTotalRelation($total_relation)
+    {
+        if (is_null($total_relation)) {
+            throw new \InvalidArgumentException('non-nullable total_relation cannot be null');
+        }
+        $this->container['total_relation'] = $total_relation;
+
+        return $this;
+    }
+
+    /**
+     * Gets last_page
+     *
+     * @return int|null
+     */
+    public function getLastPage()
+    {
+        return $this->container['last_page'];
+    }
+
+    /**
+     * Sets last_page
+     *
+     * @param int|null $last_page 最后一页(受翻页深度限制)
+     *
+     * @return self
+     */
+    public function setLastPage($last_page)
+    {
+        if (is_null($last_page)) {
+            throw new \InvalidArgumentException('non-nullable last_page cannot be null');
+        }
+        $this->container['last_page'] = $last_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets facets
+     *
+     * @return array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>|null
+     */
+    public function getFacets()
+    {
+        return $this->container['facets'];
+    }
+
+    /**
+     * Sets facets
+     *
+     * @param array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>|null $facets 分面计数,只在 facets=true 时出现。键是 resource_type / language / category / granularity
+     *
+     * @return self
+     */
+    public function setFacets($facets)
+    {
+        if (is_null($facets)) {
+            throw new \InvalidArgumentException('non-nullable facets cannot be null');
+        }
+        $this->container['facets'] = $facets;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 449 - 0
api-test/client/lib/Model/GetApiV3Search200ResponseMetaFacetsValueInner.php

@@ -0,0 +1,449 @@
+<?php
+/**
+ * GetApiV3Search200ResponseMetaFacetsValueInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Search200ResponseMetaFacetsValueInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Search200ResponseMetaFacetsValueInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_search_200_response_meta_facets_value_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'key' => 'string',
+        'count' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'key' => null,
+        'count' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'key' => false,
+        'count' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'key' => 'key',
+        'count' => 'count'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'key' => 'setKey',
+        'count' => 'setCount'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'key' => 'getKey',
+        'count' => 'getCount'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('key', $data ?? [], null);
+        $this->setIfExists('count', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        if ($this->container['key'] === null) {
+            $invalidProperties[] = "'key' can't be null";
+        }
+        if ($this->container['count'] === null) {
+            $invalidProperties[] = "'count' can't be null";
+        }
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets key
+     *
+     * @return string
+     */
+    public function getKey()
+    {
+        return $this->container['key'];
+    }
+
+    /**
+     * Sets key
+     *
+     * @param string $key key
+     *
+     * @return self
+     */
+    public function setKey($key)
+    {
+        if (is_null($key)) {
+            throw new \InvalidArgumentException('non-nullable key cannot be null');
+        }
+        $this->container['key'] = $key;
+
+        return $this;
+    }
+
+    /**
+     * Gets count
+     *
+     * @return int
+     */
+    public function getCount()
+    {
+        return $this->container['count'];
+    }
+
+    /**
+     * Sets count
+     *
+     * @param int $count count
+     *
+     * @return self
+     */
+    public function setCount($count)
+    {
+        if (is_null($count)) {
+            throw new \InvalidArgumentException('non-nullable count cannot be null');
+        }
+        $this->container['count'] = $count;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

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

@@ -57,7 +57,7 @@ class GetApiV3SearchSearch200Response implements ModelInterface, ArrayAccess, \J
      * @var string[]
      */
     protected static $openAPITypes = [
-        'data' => 'object'
+        'data' => '\WikipaliApi\Model\GetApiV3Search200ResponseDataInner'
     ];
 
     /**
@@ -292,7 +292,7 @@ class GetApiV3SearchSearch200Response implements ModelInterface, ArrayAccess, \J
     /**
      * Gets data
      *
-     * @return object|null
+     * @return \WikipaliApi\Model\GetApiV3Search200ResponseDataInner|null
      */
     public function getData()
     {
@@ -302,7 +302,7 @@ class GetApiV3SearchSearch200Response implements ModelInterface, ArrayAccess, \J
     /**
      * Sets data
      *
-     * @param object|null $data data
+     * @param \WikipaliApi\Model\GetApiV3Search200ResponseDataInner|null $data data
      *
      * @return self
      */

+ 443 - 0
api-test/client/lib/Model/GetApiV3SearchSuggestions200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3SearchSuggestions200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3SearchSuggestions200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3SearchSuggestions200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_search_suggestions_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3SearchSuggestions200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3SearchSuggestions200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3SearchSuggestions200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\GetApiV3PaliWordSuggestions200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 675 - 0
api-test/client/lib/Model/GetApiV3SearchSuggestions200ResponseDataInner.php

@@ -0,0 +1,675 @@
+<?php
+/**
+ * GetApiV3SearchSuggestions200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3SearchSuggestions200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3SearchSuggestions200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_search_suggestions_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'text' => 'string',
+        'source' => 'string',
+        'score' => 'float',
+        'doc_id' => 'string',
+        'resource_type' => 'string',
+        'language' => 'string',
+        'granularity' => 'string',
+        'category' => 'string[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'text' => null,
+        'source' => null,
+        'score' => null,
+        'doc_id' => null,
+        'resource_type' => null,
+        'language' => null,
+        'granularity' => null,
+        'category' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'text' => false,
+        'source' => false,
+        'score' => false,
+        'doc_id' => true,
+        'resource_type' => true,
+        'language' => true,
+        'granularity' => true,
+        'category' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'text' => 'text',
+        'source' => 'source',
+        'score' => 'score',
+        'doc_id' => 'doc_id',
+        'resource_type' => 'resource_type',
+        'language' => 'language',
+        'granularity' => 'granularity',
+        'category' => 'category'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'text' => 'setText',
+        'source' => 'setSource',
+        'score' => 'setScore',
+        'doc_id' => 'setDocId',
+        'resource_type' => 'setResourceType',
+        'language' => 'setLanguage',
+        'granularity' => 'setGranularity',
+        'category' => 'setCategory'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'text' => 'getText',
+        'source' => 'getSource',
+        'score' => 'getScore',
+        'doc_id' => 'getDocId',
+        'resource_type' => 'getResourceType',
+        'language' => 'getLanguage',
+        'granularity' => 'getGranularity',
+        'category' => 'getCategory'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('text', $data ?? [], null);
+        $this->setIfExists('source', $data ?? [], null);
+        $this->setIfExists('score', $data ?? [], null);
+        $this->setIfExists('doc_id', $data ?? [], null);
+        $this->setIfExists('resource_type', $data ?? [], null);
+        $this->setIfExists('language', $data ?? [], null);
+        $this->setIfExists('granularity', $data ?? [], null);
+        $this->setIfExists('category', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets text
+     *
+     * @return string|null
+     */
+    public function getText()
+    {
+        return $this->container['text'];
+    }
+
+    /**
+     * Sets text
+     *
+     * @param string|null $text text
+     *
+     * @return self
+     */
+    public function setText($text)
+    {
+        if (is_null($text)) {
+            throw new \InvalidArgumentException('non-nullable text cannot be null');
+        }
+        $this->container['text'] = $text;
+
+        return $this;
+    }
+
+    /**
+     * Gets source
+     *
+     * @return string|null
+     */
+    public function getSource()
+    {
+        return $this->container['source'];
+    }
+
+    /**
+     * Sets source
+     *
+     * @param string|null $source source
+     *
+     * @return self
+     */
+    public function setSource($source)
+    {
+        if (is_null($source)) {
+            throw new \InvalidArgumentException('non-nullable source cannot be null');
+        }
+        $this->container['source'] = $source;
+
+        return $this;
+    }
+
+    /**
+     * Gets score
+     *
+     * @return float|null
+     */
+    public function getScore()
+    {
+        return $this->container['score'];
+    }
+
+    /**
+     * Sets score
+     *
+     * @param float|null $score score
+     *
+     * @return self
+     */
+    public function setScore($score)
+    {
+        if (is_null($score)) {
+            throw new \InvalidArgumentException('non-nullable score cannot be null');
+        }
+        $this->container['score'] = $score;
+
+        return $this;
+    }
+
+    /**
+     * Gets doc_id
+     *
+     * @return string|null
+     */
+    public function getDocId()
+    {
+        return $this->container['doc_id'];
+    }
+
+    /**
+     * Sets doc_id
+     *
+     * @param string|null $doc_id doc_id
+     *
+     * @return self
+     */
+    public function setDocId($doc_id)
+    {
+        if (is_null($doc_id)) {
+            array_push($this->openAPINullablesSetToNull, 'doc_id');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('doc_id', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['doc_id'] = $doc_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets resource_type
+     *
+     * @return string|null
+     */
+    public function getResourceType()
+    {
+        return $this->container['resource_type'];
+    }
+
+    /**
+     * Sets resource_type
+     *
+     * @param string|null $resource_type resource_type
+     *
+     * @return self
+     */
+    public function setResourceType($resource_type)
+    {
+        if (is_null($resource_type)) {
+            array_push($this->openAPINullablesSetToNull, 'resource_type');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('resource_type', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['resource_type'] = $resource_type;
+
+        return $this;
+    }
+
+    /**
+     * Gets language
+     *
+     * @return string|null
+     */
+    public function getLanguage()
+    {
+        return $this->container['language'];
+    }
+
+    /**
+     * Sets language
+     *
+     * @param string|null $language language
+     *
+     * @return self
+     */
+    public function setLanguage($language)
+    {
+        if (is_null($language)) {
+            array_push($this->openAPINullablesSetToNull, 'language');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('language', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['language'] = $language;
+
+        return $this;
+    }
+
+    /**
+     * Gets granularity
+     *
+     * @return string|null
+     */
+    public function getGranularity()
+    {
+        return $this->container['granularity'];
+    }
+
+    /**
+     * Sets granularity
+     *
+     * @param string|null $granularity granularity
+     *
+     * @return self
+     */
+    public function setGranularity($granularity)
+    {
+        if (is_null($granularity)) {
+            array_push($this->openAPINullablesSetToNull, 'granularity');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('granularity', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['granularity'] = $granularity;
+
+        return $this;
+    }
+
+    /**
+     * Gets category
+     *
+     * @return string[]|null
+     */
+    public function getCategory()
+    {
+        return $this->container['category'];
+    }
+
+    /**
+     * Sets category
+     *
+     * @param string[]|null $category category
+     *
+     * @return self
+     */
+    public function setCategory($category)
+    {
+        if (is_null($category)) {
+            throw new \InvalidArgumentException('non-nullable category cannot be null');
+        }
+        $this->container['category'] = $category;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3TipitakaPageNumbersPage200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaPageNumbersPage200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaPageNumbersPage200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_page_numbers_page__200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaPageNumbersPage200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 770 - 0
api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseDataInner.php

@@ -0,0 +1,770 @@
+<?php
+/**
+ * GetApiV3TipitakaPageNumbersPage200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaPageNumbersPage200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaPageNumbersPage200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_page_numbers_page__200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'edition' => 'string',
+        'volume' => 'int',
+        'page' => 'int',
+        'book' => 'int',
+        'para' => 'int',
+        'book_id' => 'int',
+        'book_title' => 'string',
+        'book_para' => 'int',
+        'edition_title' => 'string',
+        'layer' => 'string',
+        'tags' => 'string[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'edition' => null,
+        'volume' => null,
+        'page' => null,
+        'book' => null,
+        'para' => null,
+        'book_id' => null,
+        'book_title' => null,
+        'book_para' => null,
+        'edition_title' => null,
+        'layer' => null,
+        'tags' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'edition' => false,
+        'volume' => true,
+        'page' => false,
+        'book' => false,
+        'para' => false,
+        'book_id' => false,
+        'book_title' => false,
+        'book_para' => false,
+        'edition_title' => true,
+        'layer' => true,
+        'tags' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'edition' => 'edition',
+        'volume' => 'volume',
+        'page' => 'page',
+        'book' => 'book',
+        'para' => 'para',
+        'book_id' => 'book_id',
+        'book_title' => 'book_title',
+        'book_para' => 'book_para',
+        'edition_title' => 'edition_title',
+        'layer' => 'layer',
+        'tags' => 'tags'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'edition' => 'setEdition',
+        'volume' => 'setVolume',
+        'page' => 'setPage',
+        'book' => 'setBook',
+        'para' => 'setPara',
+        'book_id' => 'setBookId',
+        'book_title' => 'setBookTitle',
+        'book_para' => 'setBookPara',
+        'edition_title' => 'setEditionTitle',
+        'layer' => 'setLayer',
+        'tags' => 'setTags'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'edition' => 'getEdition',
+        'volume' => 'getVolume',
+        'page' => 'getPage',
+        'book' => 'getBook',
+        'para' => 'getPara',
+        'book_id' => 'getBookId',
+        'book_title' => 'getBookTitle',
+        'book_para' => 'getBookPara',
+        'edition_title' => 'getEditionTitle',
+        'layer' => 'getLayer',
+        'tags' => 'getTags'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('edition', $data ?? [], null);
+        $this->setIfExists('volume', $data ?? [], null);
+        $this->setIfExists('page', $data ?? [], null);
+        $this->setIfExists('book', $data ?? [], null);
+        $this->setIfExists('para', $data ?? [], null);
+        $this->setIfExists('book_id', $data ?? [], null);
+        $this->setIfExists('book_title', $data ?? [], null);
+        $this->setIfExists('book_para', $data ?? [], null);
+        $this->setIfExists('edition_title', $data ?? [], null);
+        $this->setIfExists('layer', $data ?? [], null);
+        $this->setIfExists('tags', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets edition
+     *
+     * @return string|null
+     */
+    public function getEdition()
+    {
+        return $this->container['edition'];
+    }
+
+    /**
+     * Sets edition
+     *
+     * @param string|null $edition edition
+     *
+     * @return self
+     */
+    public function setEdition($edition)
+    {
+        if (is_null($edition)) {
+            throw new \InvalidArgumentException('non-nullable edition cannot be null');
+        }
+        $this->container['edition'] = $edition;
+
+        return $this;
+    }
+
+    /**
+     * Gets volume
+     *
+     * @return int|null
+     */
+    public function getVolume()
+    {
+        return $this->container['volume'];
+    }
+
+    /**
+     * Sets volume
+     *
+     * @param int|null $volume volume
+     *
+     * @return self
+     */
+    public function setVolume($volume)
+    {
+        if (is_null($volume)) {
+            array_push($this->openAPINullablesSetToNull, 'volume');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('volume', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['volume'] = $volume;
+
+        return $this;
+    }
+
+    /**
+     * Gets page
+     *
+     * @return int|null
+     */
+    public function getPage()
+    {
+        return $this->container['page'];
+    }
+
+    /**
+     * Sets page
+     *
+     * @param int|null $page page
+     *
+     * @return self
+     */
+    public function setPage($page)
+    {
+        if (is_null($page)) {
+            throw new \InvalidArgumentException('non-nullable page cannot be null');
+        }
+        $this->container['page'] = $page;
+
+        return $this;
+    }
+
+    /**
+     * Gets book
+     *
+     * @return int|null
+     */
+    public function getBook()
+    {
+        return $this->container['book'];
+    }
+
+    /**
+     * Sets book
+     *
+     * @param int|null $book book
+     *
+     * @return self
+     */
+    public function setBook($book)
+    {
+        if (is_null($book)) {
+            throw new \InvalidArgumentException('non-nullable book cannot be null');
+        }
+        $this->container['book'] = $book;
+
+        return $this;
+    }
+
+    /**
+     * Gets para
+     *
+     * @return int|null
+     */
+    public function getPara()
+    {
+        return $this->container['para'];
+    }
+
+    /**
+     * Sets para
+     *
+     * @param int|null $para para
+     *
+     * @return self
+     */
+    public function setPara($para)
+    {
+        if (is_null($para)) {
+            throw new \InvalidArgumentException('non-nullable para cannot be null');
+        }
+        $this->container['para'] = $para;
+
+        return $this;
+    }
+
+    /**
+     * Gets book_id
+     *
+     * @return int|null
+     */
+    public function getBookId()
+    {
+        return $this->container['book_id'];
+    }
+
+    /**
+     * Sets book_id
+     *
+     * @param int|null $book_id book_id
+     *
+     * @return self
+     */
+    public function setBookId($book_id)
+    {
+        if (is_null($book_id)) {
+            throw new \InvalidArgumentException('non-nullable book_id cannot be null');
+        }
+        $this->container['book_id'] = $book_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets book_title
+     *
+     * @return string|null
+     */
+    public function getBookTitle()
+    {
+        return $this->container['book_title'];
+    }
+
+    /**
+     * Sets book_title
+     *
+     * @param string|null $book_title book_title
+     *
+     * @return self
+     */
+    public function setBookTitle($book_title)
+    {
+        if (is_null($book_title)) {
+            throw new \InvalidArgumentException('non-nullable book_title cannot be null');
+        }
+        $this->container['book_title'] = $book_title;
+
+        return $this;
+    }
+
+    /**
+     * Gets book_para
+     *
+     * @return int|null
+     */
+    public function getBookPara()
+    {
+        return $this->container['book_para'];
+    }
+
+    /**
+     * Sets book_para
+     *
+     * @param int|null $book_para book_para
+     *
+     * @return self
+     */
+    public function setBookPara($book_para)
+    {
+        if (is_null($book_para)) {
+            throw new \InvalidArgumentException('non-nullable book_para cannot be null');
+        }
+        $this->container['book_para'] = $book_para;
+
+        return $this;
+    }
+
+    /**
+     * Gets edition_title
+     *
+     * @return string|null
+     */
+    public function getEditionTitle()
+    {
+        return $this->container['edition_title'];
+    }
+
+    /**
+     * Sets edition_title
+     *
+     * @param string|null $edition_title edition_title
+     *
+     * @return self
+     */
+    public function setEditionTitle($edition_title)
+    {
+        if (is_null($edition_title)) {
+            array_push($this->openAPINullablesSetToNull, 'edition_title');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('edition_title', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['edition_title'] = $edition_title;
+
+        return $this;
+    }
+
+    /**
+     * Gets layer
+     *
+     * @return string|null
+     */
+    public function getLayer()
+    {
+        return $this->container['layer'];
+    }
+
+    /**
+     * Sets layer
+     *
+     * @param string|null $layer layer
+     *
+     * @return self
+     */
+    public function setLayer($layer)
+    {
+        if (is_null($layer)) {
+            array_push($this->openAPINullablesSetToNull, 'layer');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('layer', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['layer'] = $layer;
+
+        return $this;
+    }
+
+    /**
+     * Gets tags
+     *
+     * @return string[]|null
+     */
+    public function getTags()
+    {
+        return $this->container['tags'];
+    }
+
+    /**
+     * Sets tags
+     *
+     * @param string[]|null $tags tags
+     *
+     * @return self
+     */
+    public function setTags($tags)
+    {
+        if (is_null($tags)) {
+            throw new \InvalidArgumentException('non-nullable tags cannot be null');
+        }
+        $this->container['tags'] = $tags;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/GetApiV3TipitakaPageNumbersPage200ResponseMeta.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3TipitakaPageNumbersPage200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaPageNumbersPage200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaPageNumbersPage200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_page_numbers_page__200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'total' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'total' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'total' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'total' => 'total'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'total' => 'setTotal'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'total' => 'getTotal'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('total', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 命中数
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 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

+ 443 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphs200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphs200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphs200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PaginationMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PaginationMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PaginationMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 715 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInner.php

@@ -0,0 +1,715 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphs200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphs200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphs200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'id' => 'string',
+        'book' => 'int',
+        'para' => 'int',
+        'score' => 'int',
+        'hits' => 'int',
+        'title' => 'string',
+        'level' => 'int',
+        'path' => '\WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]',
+        'text' => 'string',
+        'refs' => '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner[]'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'id' => null,
+        'book' => null,
+        'para' => null,
+        'score' => null,
+        'hits' => null,
+        'title' => null,
+        'level' => null,
+        'path' => null,
+        'text' => null,
+        'refs' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'id' => false,
+        'book' => false,
+        'para' => false,
+        'score' => false,
+        'hits' => false,
+        'title' => false,
+        'level' => false,
+        'path' => false,
+        'text' => false,
+        'refs' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'id' => 'id',
+        'book' => 'book',
+        'para' => 'para',
+        'score' => 'score',
+        'hits' => 'hits',
+        'title' => 'title',
+        'level' => 'level',
+        'path' => 'path',
+        'text' => 'text',
+        'refs' => 'refs'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'id' => 'setId',
+        'book' => 'setBook',
+        'para' => 'setPara',
+        'score' => 'setScore',
+        'hits' => 'setHits',
+        'title' => 'setTitle',
+        'level' => 'setLevel',
+        'path' => 'setPath',
+        'text' => 'setText',
+        'refs' => 'setRefs'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'id' => 'getId',
+        'book' => 'getBook',
+        'para' => 'getPara',
+        'score' => 'getScore',
+        'hits' => 'getHits',
+        'title' => 'getTitle',
+        'level' => 'getLevel',
+        'path' => 'getPath',
+        'text' => 'getText',
+        'refs' => 'getRefs'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('id', $data ?? [], null);
+        $this->setIfExists('book', $data ?? [], null);
+        $this->setIfExists('para', $data ?? [], null);
+        $this->setIfExists('score', $data ?? [], null);
+        $this->setIfExists('hits', $data ?? [], null);
+        $this->setIfExists('title', $data ?? [], null);
+        $this->setIfExists('level', $data ?? [], null);
+        $this->setIfExists('path', $data ?? [], null);
+        $this->setIfExists('text', $data ?? [], null);
+        $this->setIfExists('refs', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets id
+     *
+     * @return string|null
+     */
+    public function getId()
+    {
+        return $this->container['id'];
+    }
+
+    /**
+     * Sets id
+     *
+     * @param string|null $id id
+     *
+     * @return self
+     */
+    public function setId($id)
+    {
+        if (is_null($id)) {
+            throw new \InvalidArgumentException('non-nullable id cannot be null');
+        }
+        $this->container['id'] = $id;
+
+        return $this;
+    }
+
+    /**
+     * Gets book
+     *
+     * @return int|null
+     */
+    public function getBook()
+    {
+        return $this->container['book'];
+    }
+
+    /**
+     * Sets book
+     *
+     * @param int|null $book book
+     *
+     * @return self
+     */
+    public function setBook($book)
+    {
+        if (is_null($book)) {
+            throw new \InvalidArgumentException('non-nullable book cannot be null');
+        }
+        $this->container['book'] = $book;
+
+        return $this;
+    }
+
+    /**
+     * Gets para
+     *
+     * @return int|null
+     */
+    public function getPara()
+    {
+        return $this->container['para'];
+    }
+
+    /**
+     * Sets para
+     *
+     * @param int|null $para para
+     *
+     * @return self
+     */
+    public function setPara($para)
+    {
+        if (is_null($para)) {
+            throw new \InvalidArgumentException('non-nullable para cannot be null');
+        }
+        $this->container['para'] = $para;
+
+        return $this;
+    }
+
+    /**
+     * Gets score
+     *
+     * @return int|null
+     */
+    public function getScore()
+    {
+        return $this->container['score'];
+    }
+
+    /**
+     * Sets score
+     *
+     * @param int|null $score score
+     *
+     * @return self
+     */
+    public function setScore($score)
+    {
+        if (is_null($score)) {
+            throw new \InvalidArgumentException('non-nullable score cannot be null');
+        }
+        $this->container['score'] = $score;
+
+        return $this;
+    }
+
+    /**
+     * Gets hits
+     *
+     * @return int|null
+     */
+    public function getHits()
+    {
+        return $this->container['hits'];
+    }
+
+    /**
+     * Sets hits
+     *
+     * @param int|null $hits hits
+     *
+     * @return self
+     */
+    public function setHits($hits)
+    {
+        if (is_null($hits)) {
+            throw new \InvalidArgumentException('non-nullable hits cannot be null');
+        }
+        $this->container['hits'] = $hits;
+
+        return $this;
+    }
+
+    /**
+     * Gets title
+     *
+     * @return string|null
+     */
+    public function getTitle()
+    {
+        return $this->container['title'];
+    }
+
+    /**
+     * Sets title
+     *
+     * @param string|null $title title
+     *
+     * @return self
+     */
+    public function setTitle($title)
+    {
+        if (is_null($title)) {
+            throw new \InvalidArgumentException('non-nullable title cannot be null');
+        }
+        $this->container['title'] = $title;
+
+        return $this;
+    }
+
+    /**
+     * Gets level
+     *
+     * @return int|null
+     */
+    public function getLevel()
+    {
+        return $this->container['level'];
+    }
+
+    /**
+     * Sets level
+     *
+     * @param int|null $level level
+     *
+     * @return self
+     */
+    public function setLevel($level)
+    {
+        if (is_null($level)) {
+            throw new \InvalidArgumentException('non-nullable level cannot be null');
+        }
+        $this->container['level'] = $level;
+
+        return $this;
+    }
+
+    /**
+     * Gets path
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null
+     */
+    public function getPath()
+    {
+        return $this->container['path'];
+    }
+
+    /**
+     * Sets path
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaTitles200ResponseDataInnerPathInner[]|null $path path
+     *
+     * @return self
+     */
+    public function setPath($path)
+    {
+        if (is_null($path)) {
+            throw new \InvalidArgumentException('non-nullable path cannot be null');
+        }
+        $this->container['path'] = $path;
+
+        return $this;
+    }
+
+    /**
+     * Gets text
+     *
+     * @return string|null
+     */
+    public function getText()
+    {
+        return $this->container['text'];
+    }
+
+    /**
+     * Sets text
+     *
+     * @param string|null $text text
+     *
+     * @return self
+     */
+    public function setText($text)
+    {
+        if (is_null($text)) {
+            throw new \InvalidArgumentException('non-nullable text cannot be null');
+        }
+        $this->container['text'] = $text;
+
+        return $this;
+    }
+
+    /**
+     * Gets refs
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner[]|null
+     */
+    public function getRefs()
+    {
+        return $this->container['refs'];
+    }
+
+    /**
+     * Sets refs
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner[]|null $refs refs
+     *
+     * @return self
+     */
+    public function setRefs($refs)
+    {
+        if (is_null($refs)) {
+            throw new \InvalidArgumentException('non-nullable refs cannot be null');
+        }
+        $this->container['refs'] = $refs;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 525 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner.php

@@ -0,0 +1,525 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphs200ResponseDataInnerRefsInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_200_response_data_inner_refs_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'type' => 'string',
+        'volume' => 'int',
+        'page' => 'int',
+        'title' => 'string'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'type' => null,
+        'volume' => null,
+        'page' => null,
+        'title' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'type' => false,
+        'volume' => true,
+        'page' => false,
+        'title' => true
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'type' => 'type',
+        'volume' => 'volume',
+        'page' => 'page',
+        'title' => 'title'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'type' => 'setType',
+        'volume' => 'setVolume',
+        'page' => 'setPage',
+        'title' => 'setTitle'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'type' => 'getType',
+        'volume' => 'getVolume',
+        'page' => 'getPage',
+        'title' => 'getTitle'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('type', $data ?? [], null);
+        $this->setIfExists('volume', $data ?? [], null);
+        $this->setIfExists('page', $data ?? [], null);
+        $this->setIfExists('title', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets type
+     *
+     * @return string|null
+     */
+    public function getType()
+    {
+        return $this->container['type'];
+    }
+
+    /**
+     * Sets type
+     *
+     * @param string|null $type type
+     *
+     * @return self
+     */
+    public function setType($type)
+    {
+        if (is_null($type)) {
+            throw new \InvalidArgumentException('non-nullable type cannot be null');
+        }
+        $this->container['type'] = $type;
+
+        return $this;
+    }
+
+    /**
+     * Gets volume
+     *
+     * @return int|null
+     */
+    public function getVolume()
+    {
+        return $this->container['volume'];
+    }
+
+    /**
+     * Sets volume
+     *
+     * @param int|null $volume volume
+     *
+     * @return self
+     */
+    public function setVolume($volume)
+    {
+        if (is_null($volume)) {
+            array_push($this->openAPINullablesSetToNull, 'volume');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('volume', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['volume'] = $volume;
+
+        return $this;
+    }
+
+    /**
+     * Gets page
+     *
+     * @return int|null
+     */
+    public function getPage()
+    {
+        return $this->container['page'];
+    }
+
+    /**
+     * Sets page
+     *
+     * @param int|null $page page
+     *
+     * @return self
+     */
+    public function setPage($page)
+    {
+        if (is_null($page)) {
+            throw new \InvalidArgumentException('non-nullable page cannot be null');
+        }
+        $this->container['page'] = $page;
+
+        return $this;
+    }
+
+    /**
+     * Gets title
+     *
+     * @return string|null
+     */
+    public function getTitle()
+    {
+        return $this->container['title'];
+    }
+
+    /**
+     * Sets title
+     *
+     * @param string|null $title title
+     *
+     * @return self
+     */
+    public function setTitle($title)
+    {
+        if (is_null($title)) {
+            array_push($this->openAPINullablesSetToNull, 'title');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('title', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['title'] = $title;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphsAggregate200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_aggregate_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 654 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner.php

@@ -0,0 +1,654 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphsAggregate200ResponseDataInner implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_aggregate_200_response_data_inner';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'book_id' => 'int',
+        'book' => 'int',
+        'para' => 'int',
+        'title' => 'string',
+        'layer' => 'string',
+        'tags' => 'string[]',
+        'paragraphs' => 'int',
+        'occurrences' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'book_id' => null,
+        'book' => null,
+        'para' => null,
+        'title' => null,
+        'layer' => null,
+        'tags' => null,
+        'paragraphs' => null,
+        'occurrences' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'book_id' => false,
+        'book' => false,
+        'para' => false,
+        'title' => false,
+        'layer' => true,
+        'tags' => false,
+        'paragraphs' => false,
+        'occurrences' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'book_id' => 'book_id',
+        'book' => 'book',
+        'para' => 'para',
+        'title' => 'title',
+        'layer' => 'layer',
+        'tags' => 'tags',
+        'paragraphs' => 'paragraphs',
+        'occurrences' => 'occurrences'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'book_id' => 'setBookId',
+        'book' => 'setBook',
+        'para' => 'setPara',
+        'title' => 'setTitle',
+        'layer' => 'setLayer',
+        'tags' => 'setTags',
+        'paragraphs' => 'setParagraphs',
+        'occurrences' => 'setOccurrences'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'book_id' => 'getBookId',
+        'book' => 'getBook',
+        'para' => 'getPara',
+        'title' => 'getTitle',
+        'layer' => 'getLayer',
+        'tags' => 'getTags',
+        'paragraphs' => 'getParagraphs',
+        'occurrences' => 'getOccurrences'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('book_id', $data ?? [], null);
+        $this->setIfExists('book', $data ?? [], null);
+        $this->setIfExists('para', $data ?? [], null);
+        $this->setIfExists('title', $data ?? [], null);
+        $this->setIfExists('layer', $data ?? [], null);
+        $this->setIfExists('tags', $data ?? [], null);
+        $this->setIfExists('paragraphs', $data ?? [], null);
+        $this->setIfExists('occurrences', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets book_id
+     *
+     * @return int|null
+     */
+    public function getBookId()
+    {
+        return $this->container['book_id'];
+    }
+
+    /**
+     * Sets book_id
+     *
+     * @param int|null $book_id book_id
+     *
+     * @return self
+     */
+    public function setBookId($book_id)
+    {
+        if (is_null($book_id)) {
+            throw new \InvalidArgumentException('non-nullable book_id cannot be null');
+        }
+        $this->container['book_id'] = $book_id;
+
+        return $this;
+    }
+
+    /**
+     * Gets book
+     *
+     * @return int|null
+     */
+    public function getBook()
+    {
+        return $this->container['book'];
+    }
+
+    /**
+     * Sets book
+     *
+     * @param int|null $book book
+     *
+     * @return self
+     */
+    public function setBook($book)
+    {
+        if (is_null($book)) {
+            throw new \InvalidArgumentException('non-nullable book cannot be null');
+        }
+        $this->container['book'] = $book;
+
+        return $this;
+    }
+
+    /**
+     * Gets para
+     *
+     * @return int|null
+     */
+    public function getPara()
+    {
+        return $this->container['para'];
+    }
+
+    /**
+     * Sets para
+     *
+     * @param int|null $para para
+     *
+     * @return self
+     */
+    public function setPara($para)
+    {
+        if (is_null($para)) {
+            throw new \InvalidArgumentException('non-nullable para cannot be null');
+        }
+        $this->container['para'] = $para;
+
+        return $this;
+    }
+
+    /**
+     * Gets title
+     *
+     * @return string|null
+     */
+    public function getTitle()
+    {
+        return $this->container['title'];
+    }
+
+    /**
+     * Sets title
+     *
+     * @param string|null $title title
+     *
+     * @return self
+     */
+    public function setTitle($title)
+    {
+        if (is_null($title)) {
+            throw new \InvalidArgumentException('non-nullable title cannot be null');
+        }
+        $this->container['title'] = $title;
+
+        return $this;
+    }
+
+    /**
+     * Gets layer
+     *
+     * @return string|null
+     */
+    public function getLayer()
+    {
+        return $this->container['layer'];
+    }
+
+    /**
+     * Sets layer
+     *
+     * @param string|null $layer layer
+     *
+     * @return self
+     */
+    public function setLayer($layer)
+    {
+        if (is_null($layer)) {
+            array_push($this->openAPINullablesSetToNull, 'layer');
+        } else {
+            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
+            $index = array_search('layer', $nullablesSetToNull);
+            if ($index !== FALSE) {
+                unset($nullablesSetToNull[$index]);
+                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
+            }
+        }
+        $this->container['layer'] = $layer;
+
+        return $this;
+    }
+
+    /**
+     * Gets tags
+     *
+     * @return string[]|null
+     */
+    public function getTags()
+    {
+        return $this->container['tags'];
+    }
+
+    /**
+     * Sets tags
+     *
+     * @param string[]|null $tags tags
+     *
+     * @return self
+     */
+    public function setTags($tags)
+    {
+        if (is_null($tags)) {
+            throw new \InvalidArgumentException('non-nullable tags cannot be null');
+        }
+        $this->container['tags'] = $tags;
+
+        return $this;
+    }
+
+    /**
+     * Gets paragraphs
+     *
+     * @return int|null
+     */
+    public function getParagraphs()
+    {
+        return $this->container['paragraphs'];
+    }
+
+    /**
+     * Sets paragraphs
+     *
+     * @param int|null $paragraphs paragraphs
+     *
+     * @return self
+     */
+    public function setParagraphs($paragraphs)
+    {
+        if (is_null($paragraphs)) {
+            throw new \InvalidArgumentException('non-nullable paragraphs cannot be null');
+        }
+        $this->container['paragraphs'] = $paragraphs;
+
+        return $this;
+    }
+
+    /**
+     * Gets occurrences
+     *
+     * @return int|null
+     */
+    public function getOccurrences()
+    {
+        return $this->container['occurrences'];
+    }
+
+    /**
+     * Sets occurrences
+     *
+     * @param int|null $occurrences occurrences
+     *
+     * @return self
+     */
+    public function setOccurrences($occurrences)
+    {
+        if (is_null($occurrences)) {
+            throw new \InvalidArgumentException('non-nullable occurrences cannot be null');
+        }
+        $this->container['occurrences'] = $occurrences;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 477 - 0
api-test/client/lib/Model/GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta.php

@@ -0,0 +1,477 @@
+<?php
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3TipitakaWordParagraphsAggregate200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_tipitaka_word_paragraphs_aggregate_200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'total' => 'int',
+        'paragraphs' => 'int',
+        'occurrences' => 'int'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'total' => null,
+        'paragraphs' => null,
+        'occurrences' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'total' => false,
+        'paragraphs' => false,
+        'occurrences' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'total' => 'total',
+        'paragraphs' => 'paragraphs',
+        'occurrences' => 'occurrences'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'total' => 'setTotal',
+        'paragraphs' => 'setParagraphs',
+        'occurrences' => 'setOccurrences'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'total' => 'getTotal',
+        'paragraphs' => 'getParagraphs',
+        'occurrences' => 'getOccurrences'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('total', $data ?? [], null);
+        $this->setIfExists('paragraphs', $data ?? [], null);
+        $this->setIfExists('occurrences', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 书的数目
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+
+    /**
+     * Gets paragraphs
+     *
+     * @return int|null
+     */
+    public function getParagraphs()
+    {
+        return $this->container['paragraphs'];
+    }
+
+    /**
+     * Sets paragraphs
+     *
+     * @param int|null $paragraphs 命中段落总数
+     *
+     * @return self
+     */
+    public function setParagraphs($paragraphs)
+    {
+        if (is_null($paragraphs)) {
+            throw new \InvalidArgumentException('non-nullable paragraphs cannot be null');
+        }
+        $this->container['paragraphs'] = $paragraphs;
+
+        return $this;
+    }
+
+    /**
+     * Gets occurrences
+     *
+     * @return int|null
+     */
+    public function getOccurrences()
+    {
+        return $this->container['occurrences'];
+    }
+
+    /**
+     * Sets occurrences
+     *
+     * @param int|null $occurrences 词次总数
+     *
+     * @return self
+     */
+    public function setOccurrences($occurrences)
+    {
+        if (is_null($occurrences)) {
+            throw new \InvalidArgumentException('non-nullable occurrences cannot be null');
+        }
+        $this->container['occurrences'] = $occurrences;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 409 - 0
api-test/client/lib/Model/GetApiV3Upgrade200Response.php

@@ -0,0 +1,409 @@
+<?php
+/**
+ * GetApiV3Upgrade200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * GetApiV3Upgrade200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class GetApiV3Upgrade200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'get_api_v3_upgrade_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => 'object'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return object|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param object|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 443 - 0
api-test/client/lib/Model/PostApiV3Search200Response.php

@@ -0,0 +1,443 @@
+<?php
+/**
+ * PostApiV3Search200Response
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3Search200Response Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3Search200Response implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_search_200_response';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'data' => '\WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]',
+        'meta' => '\WikipaliApi\Model\PostApiV3Search200ResponseMeta'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'data' => null,
+        'meta' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'data' => false,
+        'meta' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'data' => 'data',
+        'meta' => 'meta'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'data' => 'setData',
+        'meta' => 'setMeta'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'data' => 'getData',
+        'meta' => 'getMeta'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('data', $data ?? [], null);
+        $this->setIfExists('meta', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets data
+     *
+     * @return \WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]|null
+     */
+    public function getData()
+    {
+        return $this->container['data'];
+    }
+
+    /**
+     * Sets data
+     *
+     * @param \WikipaliApi\Model\GetApiV3Search200ResponseDataInner[]|null $data data
+     *
+     * @return self
+     */
+    public function setData($data)
+    {
+        if (is_null($data)) {
+            throw new \InvalidArgumentException('non-nullable data cannot be null');
+        }
+        $this->container['data'] = $data;
+
+        return $this;
+    }
+
+    /**
+     * Gets meta
+     *
+     * @return \WikipaliApi\Model\PostApiV3Search200ResponseMeta|null
+     */
+    public function getMeta()
+    {
+        return $this->container['meta'];
+    }
+
+    /**
+     * Sets meta
+     *
+     * @param \WikipaliApi\Model\PostApiV3Search200ResponseMeta|null $meta meta
+     *
+     * @return self
+     */
+    public function setMeta($meta)
+    {
+        if (is_null($meta)) {
+            throw new \InvalidArgumentException('non-nullable meta cannot be null');
+        }
+        $this->container['meta'] = $meta;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 579 - 0
api-test/client/lib/Model/PostApiV3Search200ResponseMeta.php

@@ -0,0 +1,579 @@
+<?php
+/**
+ * PostApiV3Search200ResponseMeta
+ *
+ * PHP version 8.1
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ */
+
+/**
+ * MINT API
+ *
+ * International Academy Of Pali Tipitaka(国际巴利三藏学院)  由 `php openapi/scripts/generate.php` 依据 api-v13 的路由与控制器源码生成。 响应统一封装为 `{ok, message, data}`;`ok=false` 时 `message` 为错误信息。
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://openapi-generator.tech
+ * Generator version: 7.25.0
+ */
+
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+namespace WikipaliApi\Model;
+
+use \ArrayAccess;
+use \WikipaliApi\ObjectSerializer;
+
+/**
+ * PostApiV3Search200ResponseMeta Class Doc Comment
+ *
+ * @category Class
+ * @package  WikipaliApi
+ * @author   OpenAPI Generator team
+ * @link     https://openapi-generator.tech
+ * @implements \ArrayAccess<string, mixed>
+ */
+class PostApiV3Search200ResponseMeta implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+    public const DISCRIMINATOR = null;
+
+    /**
+     * The original name of the model.
+     *
+     * @var string
+     */
+    protected static $openAPIModelName = 'post_api_v3_search_200_response_meta';
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @var string[]
+     */
+    protected static $openAPITypes = [
+        'current_page' => 'int',
+        'per_page' => 'int',
+        'total' => 'int',
+        'total_relation' => 'string',
+        'last_page' => 'int',
+        'facets' => 'array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>'
+    ];
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @var string[]
+     * @phpstan-var array<string, string|null>
+     * @psalm-var array<string, string|null>
+     */
+    protected static $openAPIFormats = [
+        'current_page' => null,
+        'per_page' => null,
+        'total' => null,
+        'total_relation' => null,
+        'last_page' => null,
+        'facets' => null
+    ];
+
+    /**
+     * Array of nullable properties. Used for (de)serialization
+     *
+     * @var boolean[]
+     */
+    protected static array $openAPINullables = [
+        'current_page' => false,
+        'per_page' => false,
+        'total' => false,
+        'total_relation' => false,
+        'last_page' => false,
+        'facets' => false
+    ];
+
+    /**
+     * If a nullable field gets set to null, insert it here
+     *
+     * @var boolean[]
+     */
+    protected array $openAPINullablesSetToNull = [];
+
+    /**
+     * Array of property to type mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPITypes()
+    {
+        return self::$openAPITypes;
+    }
+
+    /**
+     * Array of property to format mappings. Used for (de)serialization
+     *
+     * @return array
+     */
+    public static function openAPIFormats()
+    {
+        return self::$openAPIFormats;
+    }
+
+    /**
+     * Array of nullable properties
+     *
+     * @return array
+     */
+    protected static function openAPINullables(): array
+    {
+        return self::$openAPINullables;
+    }
+
+    /**
+     * Array of nullable field names deliberately set to null
+     *
+     * @return boolean[]
+     */
+    private function getOpenAPINullablesSetToNull(): array
+    {
+        return $this->openAPINullablesSetToNull;
+    }
+
+    /**
+     * Setter - Array of nullable field names deliberately set to null
+     *
+     * @param boolean[] $openAPINullablesSetToNull
+     */
+    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+    {
+        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+    }
+
+    /**
+     * Checks if a property is nullable
+     *
+     * @param string $property
+     * @return bool
+     */
+    public static function isNullable(string $property): bool
+    {
+        return self::openAPINullables()[$property] ?? false;
+    }
+
+    /**
+     * Checks if a nullable property is set to null.
+     *
+     * @param string $property
+     * @return bool
+     */
+    public function isNullableSetToNull(string $property): bool
+    {
+        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+    }
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @var string[]
+     */
+    protected static $attributeMap = [
+        'current_page' => 'current_page',
+        'per_page' => 'per_page',
+        'total' => 'total',
+        'total_relation' => 'total_relation',
+        'last_page' => 'last_page',
+        'facets' => 'facets'
+    ];
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @var string[]
+     */
+    protected static $setters = [
+        'current_page' => 'setCurrentPage',
+        'per_page' => 'setPerPage',
+        'total' => 'setTotal',
+        'total_relation' => 'setTotalRelation',
+        'last_page' => 'setLastPage',
+        'facets' => 'setFacets'
+    ];
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @var string[]
+     */
+    protected static $getters = [
+        'current_page' => 'getCurrentPage',
+        'per_page' => 'getPerPage',
+        'total' => 'getTotal',
+        'total_relation' => 'getTotalRelation',
+        'last_page' => 'getLastPage',
+        'facets' => 'getFacets'
+    ];
+
+    /**
+     * Array of attributes where the key is the local name,
+     * and the value is the original name
+     *
+     * @return array
+     */
+    public static function attributeMap()
+    {
+        return self::$attributeMap;
+    }
+
+    /**
+     * Array of attributes to setter functions (for deserialization of responses)
+     *
+     * @return array
+     */
+    public static function setters()
+    {
+        return self::$setters;
+    }
+
+    /**
+     * Array of attributes to getter functions (for serialization of requests)
+     *
+     * @return array
+     */
+    public static function getters()
+    {
+        return self::$getters;
+    }
+
+    /**
+     * The original name of the model.
+     *
+     * @return string
+     */
+    public function getModelName()
+    {
+        return self::$openAPIModelName;
+    }
+
+
+    /**
+     * Associative array for storing property values
+     *
+     * @var mixed[]
+     */
+    protected $container = [];
+
+    /**
+     * Constructor
+     *
+     * @param mixed[]|null $data Associated array of property values
+     *                      initializing the model
+     */
+    public function __construct(?array $data = null)
+    {
+        $this->setIfExists('current_page', $data ?? [], null);
+        $this->setIfExists('per_page', $data ?? [], null);
+        $this->setIfExists('total', $data ?? [], null);
+        $this->setIfExists('total_relation', $data ?? [], null);
+        $this->setIfExists('last_page', $data ?? [], null);
+        $this->setIfExists('facets', $data ?? [], null);
+    }
+
+    /**
+     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+     * $this->openAPINullablesSetToNull array
+     *
+     * @param string $variableName
+     * @param array  $fields
+     * @param mixed  $defaultValue
+     */
+    private function setIfExists(string $variableName, array $fields, $defaultValue): void
+    {
+        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+            $this->openAPINullablesSetToNull[] = $variableName;
+        }
+
+        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+    }
+
+    /**
+     * Show all the invalid properties with reasons.
+     *
+     * @return array invalid properties with reasons
+     */
+    public function listInvalidProperties()
+    {
+        $invalidProperties = [];
+
+        return $invalidProperties;
+    }
+
+    /**
+     * Validate all the properties in the model
+     * return true if all passed
+     *
+     * @return bool True if all properties are valid
+     */
+    public function valid()
+    {
+        return count($this->listInvalidProperties()) === 0;
+    }
+
+
+    /**
+     * Gets current_page
+     *
+     * @return int|null
+     */
+    public function getCurrentPage()
+    {
+        return $this->container['current_page'];
+    }
+
+    /**
+     * Sets current_page
+     *
+     * @param int|null $current_page 当前页
+     *
+     * @return self
+     */
+    public function setCurrentPage($current_page)
+    {
+        if (is_null($current_page)) {
+            throw new \InvalidArgumentException('non-nullable current_page cannot be null');
+        }
+        $this->container['current_page'] = $current_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets per_page
+     *
+     * @return int|null
+     */
+    public function getPerPage()
+    {
+        return $this->container['per_page'];
+    }
+
+    /**
+     * Sets per_page
+     *
+     * @param int|null $per_page 每页条数
+     *
+     * @return self
+     */
+    public function setPerPage($per_page)
+    {
+        if (is_null($per_page)) {
+            throw new \InvalidArgumentException('non-nullable per_page cannot be null');
+        }
+        $this->container['per_page'] = $per_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets total
+     *
+     * @return int|null
+     */
+    public function getTotal()
+    {
+        return $this->container['total'];
+    }
+
+    /**
+     * Sets total
+     *
+     * @param int|null $total 命中总数(total_relation 为 gte 时是下限)
+     *
+     * @return self
+     */
+    public function setTotal($total)
+    {
+        if (is_null($total)) {
+            throw new \InvalidArgumentException('non-nullable total cannot be null');
+        }
+        $this->container['total'] = $total;
+
+        return $this;
+    }
+
+    /**
+     * Gets total_relation
+     *
+     * @return string|null
+     */
+    public function getTotalRelation()
+    {
+        return $this->container['total_relation'];
+    }
+
+    /**
+     * Sets total_relation
+     *
+     * @param string|null $total_relation eq 精确,gte 表示「至少这么多」
+     *
+     * @return self
+     */
+    public function setTotalRelation($total_relation)
+    {
+        if (is_null($total_relation)) {
+            throw new \InvalidArgumentException('non-nullable total_relation cannot be null');
+        }
+        $this->container['total_relation'] = $total_relation;
+
+        return $this;
+    }
+
+    /**
+     * Gets last_page
+     *
+     * @return int|null
+     */
+    public function getLastPage()
+    {
+        return $this->container['last_page'];
+    }
+
+    /**
+     * Sets last_page
+     *
+     * @param int|null $last_page 最后一页(受翻页深度限制)
+     *
+     * @return self
+     */
+    public function setLastPage($last_page)
+    {
+        if (is_null($last_page)) {
+            throw new \InvalidArgumentException('non-nullable last_page cannot be null');
+        }
+        $this->container['last_page'] = $last_page;
+
+        return $this;
+    }
+
+    /**
+     * Gets facets
+     *
+     * @return array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>|null
+     */
+    public function getFacets()
+    {
+        return $this->container['facets'];
+    }
+
+    /**
+     * Sets facets
+     *
+     * @param array<string,\WikipaliApi\Model\GetApiV3Search200ResponseMetaFacetsValueInner[]>|null $facets 分面计数,只在 facets=true 时出现。键是 resource_type / language / category / granularity
+     *
+     * @return self
+     */
+    public function setFacets($facets)
+    {
+        if (is_null($facets)) {
+            throw new \InvalidArgumentException('non-nullable facets cannot be null');
+        }
+        $this->container['facets'] = $facets;
+
+        return $this;
+    }
+    /**
+     * Returns true if offset exists. False otherwise.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return boolean
+     */
+    public function offsetExists(mixed $offset): bool
+    {
+        return isset($this->container[$offset]);
+    }
+
+    /**
+     * Gets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return mixed|null
+     */
+    #[\ReturnTypeWillChange]
+    public function offsetGet(mixed $offset)
+    {
+        return $this->container[$offset] ?? null;
+    }
+
+    /**
+     * Sets value based on offset.
+     *
+     * @param int|null $offset Offset
+     * @param mixed    $value  Value to be set
+     *
+     * @return void
+     */
+    public function offsetSet($offset, $value): void
+    {
+        if (is_null($offset)) {
+            $this->container[] = $value;
+        } else {
+            $this->container[$offset] = $value;
+        }
+    }
+
+    /**
+     * Unsets offset.
+     *
+     * @param integer|string $offset Offset
+     *
+     * @return void
+     */
+    public function offsetUnset(mixed $offset): void
+    {
+        unset($this->container[$offset]);
+    }
+
+    /**
+     * Serializes the object to a value that can be serialized natively by json_encode().
+     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+     *
+     * @return mixed Returns data which can be serialized by json_encode(), which is a value
+     * of any type other than a resource.
+     */
+    #[\ReturnTypeWillChange]
+    public function jsonSerialize()
+    {
+       return ObjectSerializer::sanitizeForSerialization($this);
+    }
+
+    /**
+     * Gets the string presentation of the object
+     *
+     * @return string
+     */
+    public function __toString()
+    {
+        return json_encode(
+            ObjectSerializer::sanitizeForSerialization($this),
+            JSON_PRETTY_PRINT
+        );
+    }
+
+    /**
+     * Gets a header-safe presentation of the object
+     *
+     * @return string
+     */
+    public function toHeaderValue()
+    {
+        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+    }
+}
+
+

+ 165 - 23
api-test/client/lib/Model/PostApiV3SearchRequest.php

@@ -60,6 +60,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => 'string',
         'search_mode' => 'string',
         'resource_type' => 'string',
+        'resource_id' => 'string',
         'granularity' => 'string',
         'language' => 'string',
         'category' => 'string',
@@ -68,8 +69,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => 'string[]',
         'author' => 'string',
         'channel' => 'string',
+        'facets' => 'bool',
         'page' => 'int',
-        'page_size' => 'int'
+        'per_page' => 'int'
     ];
 
     /**
@@ -83,6 +85,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => null,
         'search_mode' => null,
         'resource_type' => null,
+        'resource_id' => null,
         'granularity' => null,
         'language' => null,
         'category' => null,
@@ -91,8 +94,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => null,
         'author' => null,
         'channel' => null,
+        'facets' => null,
         'page' => null,
-        'page_size' => null
+        'per_page' => null
     ];
 
     /**
@@ -104,6 +108,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => false,
         'search_mode' => false,
         'resource_type' => false,
+        'resource_id' => false,
         'granularity' => false,
         'language' => false,
         'category' => false,
@@ -112,8 +117,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => false,
         'author' => false,
         'channel' => false,
+        'facets' => false,
         'page' => false,
-        'page_size' => false
+        'per_page' => false
     ];
 
     /**
@@ -205,6 +211,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => 'q',
         'search_mode' => 'search_mode',
         'resource_type' => 'resource_type',
+        'resource_id' => 'resource_id',
         'granularity' => 'granularity',
         'language' => 'language',
         'category' => 'category',
@@ -213,8 +220,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => 'related_id',
         'author' => 'author',
         'channel' => 'channel',
+        'facets' => 'facets',
         'page' => 'page',
-        'page_size' => 'page_size'
+        'per_page' => 'per_page'
     ];
 
     /**
@@ -226,6 +234,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => 'setQ',
         'search_mode' => 'setSearchMode',
         'resource_type' => 'setResourceType',
+        'resource_id' => 'setResourceId',
         'granularity' => 'setGranularity',
         'language' => 'setLanguage',
         'category' => 'setCategory',
@@ -234,8 +243,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => 'setRelatedId',
         'author' => 'setAuthor',
         'channel' => 'setChannel',
+        'facets' => 'setFacets',
         'page' => 'setPage',
-        'page_size' => 'setPageSize'
+        'per_page' => 'setPerPage'
     ];
 
     /**
@@ -247,6 +257,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'q' => 'getQ',
         'search_mode' => 'getSearchMode',
         'resource_type' => 'getResourceType',
+        'resource_id' => 'getResourceId',
         'granularity' => 'getGranularity',
         'language' => 'getLanguage',
         'category' => 'getCategory',
@@ -255,8 +266,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         'related_id' => 'getRelatedId',
         'author' => 'getAuthor',
         'channel' => 'getChannel',
+        'facets' => 'getFacets',
         'page' => 'getPage',
-        'page_size' => 'getPageSize'
+        'per_page' => 'getPerPage'
     ];
 
     /**
@@ -305,6 +317,13 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     public const SEARCH_MODE_SEMANTIC = 'semantic';
     public const SEARCH_MODE_HYBRID = 'hybrid';
     public const SEARCH_MODE_DEFINITION = 'definition';
+    public const RESOURCE_TYPE_TIPITAKA = 'tipitaka';
+    public const RESOURCE_TYPE_ORIGINAL_TEXT = 'original_text';
+    public const RESOURCE_TYPE_TERM = 'term';
+    public const GRANULARITY_BOOK = 'book';
+    public const GRANULARITY_CHAPTER = 'chapter';
+    public const GRANULARITY_SESSION = 'session';
+    public const GRANULARITY_PARAGRAPH = 'paragraph';
 
     /**
      * Gets allowable values of the enum
@@ -322,6 +341,35 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         ];
     }
 
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getResourceTypeAllowableValues()
+    {
+        return [
+            self::RESOURCE_TYPE_TIPITAKA,
+            self::RESOURCE_TYPE_ORIGINAL_TEXT,
+            self::RESOURCE_TYPE_TERM,
+        ];
+    }
+
+    /**
+     * Gets allowable values of the enum
+     *
+     * @return string[]
+     */
+    public function getGranularityAllowableValues()
+    {
+        return [
+            self::GRANULARITY_BOOK,
+            self::GRANULARITY_CHAPTER,
+            self::GRANULARITY_SESSION,
+            self::GRANULARITY_PARAGRAPH,
+        ];
+    }
+
     /**
      * Associative array for storing property values
      *
@@ -340,6 +388,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         $this->setIfExists('q', $data ?? [], null);
         $this->setIfExists('search_mode', $data ?? [], 'fuzzy');
         $this->setIfExists('resource_type', $data ?? [], null);
+        $this->setIfExists('resource_id', $data ?? [], null);
         $this->setIfExists('granularity', $data ?? [], null);
         $this->setIfExists('language', $data ?? [], null);
         $this->setIfExists('category', $data ?? [], null);
@@ -348,8 +397,9 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         $this->setIfExists('related_id', $data ?? [], null);
         $this->setIfExists('author', $data ?? [], null);
         $this->setIfExists('channel', $data ?? [], null);
+        $this->setIfExists('facets', $data ?? [], false);
         $this->setIfExists('page', $data ?? [], 1);
-        $this->setIfExists('page_size', $data ?? [], 20);
+        $this->setIfExists('per_page', $data ?? [], 20);
     }
 
     /**
@@ -391,6 +441,24 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
             );
         }
 
+        $allowedValues = $this->getResourceTypeAllowableValues();
+        if (!is_null($this->container['resource_type']) && !in_array($this->container['resource_type'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'resource_type', must be one of '%s'",
+                $this->container['resource_type'],
+                implode("', '", $allowedValues)
+            );
+        }
+
+        $allowedValues = $this->getGranularityAllowableValues();
+        if (!is_null($this->container['granularity']) && !in_array($this->container['granularity'], $allowedValues, true)) {
+            $invalidProperties[] = sprintf(
+                "invalid value '%s' for 'granularity', must be one of '%s'",
+                $this->container['granularity'],
+                implode("', '", $allowedValues)
+            );
+        }
+
         return $invalidProperties;
     }
 
@@ -419,7 +487,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets q
      *
-     * @param string $q 搜索关键词
+     * @param string $q 检索词
      *
      * @return self
      */
@@ -492,11 +560,48 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         if (is_null($resource_type)) {
             throw new \InvalidArgumentException('non-nullable resource_type cannot be null');
         }
+        $allowedValues = $this->getResourceTypeAllowableValues();
+        if (!in_array($resource_type, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'resource_type', must be one of '%s'",
+                    $resource_type,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['resource_type'] = $resource_type;
 
         return $this;
     }
 
+    /**
+     * Gets resource_id
+     *
+     * @return string|null
+     */
+    public function getResourceId()
+    {
+        return $this->container['resource_id'];
+    }
+
+    /**
+     * Sets resource_id
+     *
+     * @param string|null $resource_id 限定某个资源 id
+     *
+     * @return self
+     */
+    public function setResourceId($resource_id)
+    {
+        if (is_null($resource_id)) {
+            throw new \InvalidArgumentException('non-nullable resource_id cannot be null');
+        }
+        $this->container['resource_id'] = $resource_id;
+
+        return $this;
+    }
+
     /**
      * Gets granularity
      *
@@ -519,6 +624,16 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         if (is_null($granularity)) {
             throw new \InvalidArgumentException('non-nullable granularity cannot be null');
         }
+        $allowedValues = $this->getGranularityAllowableValues();
+        if (!in_array($granularity, $allowedValues, true)) {
+            throw new \InvalidArgumentException(
+                sprintf(
+                    "Invalid value '%s' for 'granularity', must be one of '%s'",
+                    $granularity,
+                    implode("', '", $allowedValues)
+                )
+            );
+        }
         $this->container['granularity'] = $granularity;
 
         return $this;
@@ -537,7 +652,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets language
      *
-     * @param string|null $language 语言
+     * @param string|null $language 文档语言
      *
      * @return self
      */
@@ -564,7 +679,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets category
      *
-     * @param string|null $category 文档分类,逗号分隔
+     * @param string|null $category 分类,逗号分隔,须全部命中
      *
      * @return self
      */
@@ -591,7 +706,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets tags
      *
-     * @param string|null $tags 标签,逗号分隔
+     * @param string|null $tags 标签,逗号分隔,命中任一
      *
      * @return self
      */
@@ -618,7 +733,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets page_refs
      *
-     * @param string[]|null $page_refs 页码标记
+     * @param string[]|null $page_refs 页码标记,命中任一
      *
      * @return self
      */
@@ -645,7 +760,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets related_id
      *
-     * @param string[]|null $related_id 关联 id
+     * @param string[]|null $related_id 关联 id,命中任一
      *
      * @return self
      */
@@ -699,7 +814,7 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     /**
      * Sets channel
      *
-     * @param string|null $channel 来源 channel
+     * @param string|null $channel 来源 channel 的 uuid
      *
      * @return self
      */
@@ -713,6 +828,33 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
         return $this;
     }
 
+    /**
+     * Gets facets
+     *
+     * @return bool|null
+     */
+    public function getFacets()
+    {
+        return $this->container['facets'];
+    }
+
+    /**
+     * Sets facets
+     *
+     * @param bool|null $facets 是否返回分面计数
+     *
+     * @return self
+     */
+    public function setFacets($facets)
+    {
+        if (is_null($facets)) {
+            throw new \InvalidArgumentException('non-nullable facets cannot be null');
+        }
+        $this->container['facets'] = $facets;
+
+        return $this;
+    }
+
     /**
      * Gets page
      *
@@ -741,28 +883,28 @@ class PostApiV3SearchRequest implements ModelInterface, ArrayAccess, \JsonSerial
     }
 
     /**
-     * Gets page_size
+     * Gets per_page
      *
      * @return int|null
      */
-    public function getPageSize()
+    public function getPerPage()
     {
-        return $this->container['page_size'];
+        return $this->container['per_page'];
     }
 
     /**
-     * Sets page_size
+     * Sets per_page
      *
-     * @param int|null $page_size 每页数量,上限 100
+     * @param int|null $per_page 每页条数,上限 100
      *
      * @return self
      */
-    public function setPageSize($page_size)
+    public function setPerPage($per_page)
     {
-        if (is_null($page_size)) {
-            throw new \InvalidArgumentException('non-nullable page_size cannot be null');
+        if (is_null($per_page)) {
+            throw new \InvalidArgumentException('non-nullable per_page cannot be null');
         }
-        $this->container['page_size'] = $page_size;
+        $this->container['per_page'] = $per_page;
 
         return $this;
     }

+ 1 - 2
api-test/fixtures.php

@@ -25,9 +25,8 @@ return [
     'book_name' => 'dn1',
     'cs_para'   => 4,
 
-    // 搜索关键词 + 一条真实 OpenSearch 文档 id(search/{id} 的 200 用例)
+    // 搜索关键词(search/{id} 的 200 用例从它的检索结果里取文档 id)
     'search_q'       => 'dukkha',
-    'search_doc_id'  => 'term_f8afdcaa-ad68-4795-b3d8-d5f12bdb3a5f',
 
     // discussions 写用例挂的句子:放在测试账号自己的 channel 里、由测试账号编辑,
     // 这样即便有通知也只发给自己(用例本身还会带 notify=false)。换环境时按需覆盖。

+ 1 - 10
api-test/tools/filter-v3.php

@@ -137,21 +137,12 @@ function normalizeArraySchemas(mixed &$node): void
     unset($value);
 }
 
-/** 修正 search / search-suggest / upgrade 的 200 响应 schema,使其与实现一致 */
+/** 修正 upgrade 的 200 响应 schema,使其与实现一致(/v3/search 与 search-suggestions 已于 2026-11-19 对齐,不再打补丁) */
 function applyDriftPatches(array &$spec): void
 {
     $object = ['type' => 'object'];
     $dataObject = ['type' => 'object', 'properties' => ['data' => $object]];
-    $successData = ['type' => 'object', 'properties' => ['success' => ['type' => 'boolean'], 'data' => $object]];
 
-    foreach (['get', 'post'] as $method) {
-        if (isset($spec['paths']['/v3/search'][$method]['responses']['200']['content']['application/json']['schema'])) {
-            $spec['paths']['/v3/search'][$method]['responses']['200']['content']['application/json']['schema'] = $successData;
-        }
-    }
-    if (isset($spec['paths']['/v3/search-suggest']['get']['responses']['200']['content']['application/json']['schema'])) {
-        $spec['paths']['/v3/search-suggest']['get']['responses']['200']['content']['application/json']['schema'] = $successData;
-    }
     if (isset($spec['paths']['/v3/upgrade']['get']['responses']['200']['content']['application/json']['schema'])) {
         $spec['paths']['/v3/upgrade']['get']['responses']['200']['content']['application/json']['schema'] = $dataObject;
     }

+ 2 - 0
api-v13/app/Http/Controllers/Library/AnthologyReadController.php

@@ -113,6 +113,8 @@ class AnthologyReadController extends Controller
                 'id' => $anthologyId,
                 'title' => $col['title'] ?? '',
             ],
+            // 目录栏标题(book.read 视图无条件读取):文集阅读页的「书」就是文集本身
+            'book_title' => $col['title'] ?? '',
             'categories' => [],
             'tags' => [],
             'downloads' => [],

+ 37 - 0
api-v13/app/Http/Controllers/V3/PaliWordFormController.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Resources\V3\PaliWordFormResource;
+use App\Services\V3\PaliWordFormService;
+
+/**
+ * 巴利词形展开(只读、公开)。
+ *
+ * 取代 `GET /v2/case/{word}`(`CaseController@show`)。v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ */
+class PaliWordFormController extends Controller
+{
+    public function __construct(private readonly PaliWordFormService $forms) {}
+
+    /**
+     * 词形展开
+     *
+     * 把一个巴利词还原成可能的词根,列出每个词根在三藏里实际出现过的词形(含 iti / api / ca / hi 连音),
+     * 带出现次数与黑体次数。第一组是输入的词本身,其后是推导出的词根;没有任何词形出现过的词根不列。
+     * 每组内按出现次数降序。词不区分大小写。
+     *
+     * @unauthenticated
+     *
+     * @urlParam word string required 巴利词,如 vitakka
+     *
+     * @meta total integer 组数
+     */
+    public function __invoke(string $word)
+    {
+        $groups = $this->forms->groups($word);
+
+        return PaliWordFormResource::collection($groups)->additional(['meta' => ['total' => count($groups)]]);
+    }
+}

+ 39 - 0
api-v13/app/Http/Controllers/V3/PaliWordSuggestionController.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexPaliWordSuggestionRequest;
+use App\Http\Resources\V3\PaliWordSuggestionResource;
+use App\Services\V3\PaliWordSuggestionService;
+
+/**
+ * 巴利词补全(只读、公开)。
+ *
+ * 取代 `GET /v2/pali-word-index?view=key`(`WordIndexController@index`)。v2 那份在 dashboard-v4
+ * 下线前原样保留,不要改动。
+ */
+class PaliWordSuggestionController extends Controller
+{
+    public function __construct(private readonly PaliWordSuggestionService $words) {}
+
+    /**
+     * 巴利词补全
+     *
+     * 按已输入的前缀列出三藏里出现过的词形,带出现次数与黑体次数。前缀同时匹配去掉变音符号的写法
+     * (输入 dhamma 也能补出 dhammā),不区分大小写。与输入完全相同的词排在最前,其余按出现次数降序。
+     *
+     * @unauthenticated
+     *
+     * @queryParam q string required 已输入的前缀。Example: vitakk
+     * @queryParam limit integer 最多返回几条,上限 50。Default: 10
+     *
+     * @meta total integer 本次返回的条数
+     */
+    public function __invoke(IndexPaliWordSuggestionRequest $request)
+    {
+        $items = $this->words->suggest($request->validated('q'), $request->integer('limit', 10));
+
+        return PaliWordSuggestionResource::collection($items)->additional(['meta' => ['total' => count($items)]]);
+    }
+}

+ 123 - 0
api-v13/app/Http/Controllers/V3/SearchController.php

@@ -0,0 +1,123 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Concerns\ResolvesCurrentUser;
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexSearchRequest;
+use App\Http\Resources\V3\SearchHitResource;
+use App\Services\V3\SearchService;
+use Illuminate\Http\Request;
+
+/**
+ * 全文检索(OpenSearch)
+ *
+ * 曾叫 `SearchPlusController`,2026-11-19 按 v3 规范重写:FormRequest 校验入参、
+ * 响应改成 `{data, meta}`(不再透出 OpenSearch 原始响应)、失败走 Problem Details。
+ * 与 v2 的 `SearchController`(`/v2/search`,PostgreSQL 全文检索)是两套实现,互不替代。
+ */
+class SearchController extends Controller
+{
+    use ResolvesCurrentUser;
+
+    public function __construct(private readonly SearchService $search) {}
+
+    /**
+     * 全文检索
+     *
+     * 底层走 OpenSearch。同样的参数也可以用 `POST /v3/search` 放在请求体里提交。
+     * 翻页深度受 OpenSearch 限制:`page × per_page` 不能超过 10000,超出 422。
+     * 搜索服务连不上或超时回 503(`search-unavailable`)。
+     *
+     * @unauthenticated
+     *
+     * @queryParam q string required 检索词
+     * @queryParam search_mode string 检索模式:fuzzy 多词模糊(默认)、exact 词形精确、semantic 语义向量、hybrid 模糊 + 语义、definition 黑体定义优先。Enum: fuzzy,exact,semantic,hybrid,definition Default: fuzzy
+     * @queryParam resource_type string 资源类型:tipitaka 三藏(段落与整章)、original_text 原文分段、term 术语。Enum: tipitaka,original_text,term
+     * @queryParam resource_id string 限定某个资源 id
+     * @queryParam granularity string 文档颗粒度。Enum: book,chapter,session,paragraph
+     * @queryParam language string 文档语言,如 pi、zh、en
+     * @queryParam category string 分类,逗号分隔,须全部命中。Example: sutta,mūla
+     * @queryParam tags string 标签,逗号分隔,命中任一
+     * @queryParam page_refs array 页码标记,命中任一。Example: ["V3.81","M3.58"]
+     * @queryParam related_id array 关联 id(经文段落是 `{book}-{para}`),命中任一。Example: ["93-5"]
+     * @queryParam author string 作者或译者
+     * @queryParam channel string 来源 channel 的 uuid
+     * @queryParam facets boolean 是否在 `meta.facets` 里返回按 resource_type / language / category / granularity 的分面计数。Default: false
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页条数,上限 100。Default: 20
+     *
+     * @responseStatus 503 搜索服务暂不可用
+     *
+     * @meta current_page integer 当前页
+     * @meta per_page integer 每页条数
+     * @meta total integer 命中总数(total_relation 为 gte 时是下限)
+     * @meta total_relation string eq 精确,gte 表示「至少这么多」(OpenSearch 只精确计数到 10000)
+     * @meta last_page integer 最后一页(受翻页深度限制)
+     * @meta facets object 分面计数,只在 facets=true 时出现
+     */
+    public function index(IndexSearchRequest $request)
+    {
+        $result = $this->search->search($request->validated());
+
+        return SearchHitResource::collection($result['items'])->additional(['meta' => $result['meta']]);
+    }
+
+    /**
+     * 全文检索(POST)
+     *
+     * 与 `GET /v3/search` 完全等价,参数放在 JSON 请求体里(数组参数多、URL 放不下时用)。
+     *
+     * @unauthenticated
+     *
+     * @bodyParam q string required 检索词
+     * @bodyParam search_mode string 检索模式。Enum: fuzzy,exact,semantic,hybrid,definition Default: fuzzy
+     * @bodyParam resource_type string 资源类型。Enum: tipitaka,original_text,term
+     * @bodyParam resource_id string 限定某个资源 id
+     * @bodyParam granularity string 文档颗粒度。Enum: book,chapter,session,paragraph
+     * @bodyParam language string 文档语言
+     * @bodyParam category string 分类,逗号分隔,须全部命中
+     * @bodyParam tags string 标签,逗号分隔,命中任一
+     * @bodyParam page_refs array 页码标记,命中任一
+     * @bodyParam related_id array 关联 id,命中任一
+     * @bodyParam author string 作者或译者
+     * @bodyParam channel string 来源 channel 的 uuid
+     * @bodyParam facets boolean 是否返回分面计数。Default: false
+     * @bodyParam page integer 页码。Default: 1
+     * @bodyParam per_page integer 每页条数,上限 100。Default: 20
+     *
+     * @responseStatus 503 搜索服务暂不可用
+     *
+     * @meta current_page integer 当前页
+     * @meta per_page integer 每页条数
+     * @meta total integer 命中总数(total_relation 为 gte 时是下限)
+     * @meta total_relation string eq 精确,gte 表示「至少这么多」
+     * @meta last_page integer 最后一页(受翻页深度限制)
+     * @meta facets object 分面计数,只在 facets=true 时出现
+     */
+    public function store(IndexSearchRequest $request)
+    {
+        $result = $this->search->search($request->validated());
+
+        return SearchHitResource::collection($result['items'])->additional(['meta' => $result['meta']]);
+    }
+
+    /**
+     * 按 id 取单条检索文档
+     *
+     * 直接从 OpenSearch 按文档 id 取回,带阅读用的 `display` HTML。
+     * 整章正文文档(`tipitaka_chapter_{book}-{para}_{channel}`)按它所属 channel 判权限:
+     * 私有 channel 只有拥有者、团队成员、被共享的人能读(要带 token)。
+     *
+     * @unauthenticated
+     *
+     * @urlParam search string required OpenSearch 文档 id
+     *
+     * @responseStatus 403 整章正文所属的 channel 是私有的,且当前身份看不见
+     * @responseStatus 503 搜索服务暂不可用
+     */
+    public function show(Request $request, string $search): SearchHitResource
+    {
+        return SearchHitResource::make($this->search->find($search, $this->currentUserUid($request)));
+    }
+}

+ 0 - 171
api-v13/app/Http/Controllers/V3/SearchPlusController.php

@@ -1,171 +0,0 @@
-<?php
-
-namespace App\Http\Controllers\V3;
-
-use App\DTO\Search\HitItemDTO;
-use App\Http\Controllers\Concerns\ResolvesCurrentUser;
-use App\Http\Controllers\Controller;
-use App\Http\Resources\V3\BaseResource;
-use App\Services\OpenSearchService;
-use App\Services\V3\ChannelAbilityService;
-use Illuminate\Http\Request;
-
-class SearchPlusController extends Controller
-{
-    /**
-     * 构造函数,注入 OpenSearchService
-     */
-    use ResolvesCurrentUser;
-
-    /** 整章正文文档的 id:tipitaka_chapter_{book}-{para}_{channel uuid},见 IndexTipitaka */
-    private const CHAPTER_DOC = '/^tipitaka_chapter_\d+-\d+_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i';
-
-    public function __construct(
-        protected OpenSearchService $searchService,
-        private readonly ChannelAbilityService $abilities,
-    ) {}
-
-    /**
-     * 全文检索
-     *
-     * 支持 fuzzy / exact / semantic / hybrid 四种检索模式,底层走 OpenSearch。
-     * 同样的参数也可以用 POST /v3/search 提交(参数多、URL 放不下时用)。
-     *
-     * @unauthenticated
-     *
-     * @queryParam q string required 搜索关键词
-     * @queryParam search_mode string 检索模式。Enum: fuzzy,exact,semantic,hybrid,definition Default: fuzzy
-     * @queryParam resource_type string 资源类型。
-     *             Enum: article,term,dictionary,translation,origin_text,nissaya
-     * @queryParam resource_id string 限定某个资源 id
-     * @queryParam granularity string 文档颗粒度。
-     *             Enum: book,chapter,sutta,section,paragraph,sentence
-     * @queryParam language string 语言。Example: zh-Hans
-     * @queryParam category string 文档分类,逗号分隔。Enum: pali,commentary,subcommentary
-     * @queryParam tags string 标签过滤,逗号分隔
-     * @queryParam page_refs array 页码标记。Example: ["V3.81","M3.58"]
-     * @queryParam related_id array 关联 id。Example: ["chapter_93-5","m.n. 38"]
-     * @queryParam author string 按作者或译者过滤
-     * @queryParam channel string 按来源 channel 过滤
-     * @queryParam page integer 页码。Default: 1
-     * @queryParam page_size integer 每页数量,上限 100。Default: 20
-     */
-    public function index(Request $request)
-    {
-        // 获取所有输入参数(自动兼容 GET 和 POST)
-        $input = $request->all();
-
-        // 基础参数 - 使用 $input 或直接用 $request->input() (已兼容 GET/POST)
-        $query = $request->input('q', '');
-        $page = max(1, (int) $request->input('page', 1));
-        $pageSize = min(100, (int) $request->input('page_size', 20));
-        $searchMode = $request->input('search_mode', 'fuzzy');
-        $resourceType = $request->input('resource_type'); // 资源类型
-        $resourceId = $request->input('resource_id'); // 资源类型
-        $granularity = $request->input('granularity');   // 文档颗粒度
-        $language = $request->input('language');      // 语言
-        $category = $request->has('category') ? explode(',', $request->input('category')) : null;      // 分类
-        $tags = $request->has('tags') ? explode(',', $request->input('tags')) : [];      // 标签
-        $pageRefs = $request->input('page_refs', []); // 页码标记
-        $relatedId = $request->input('related_id'); // 关联 ID
-        $author = $request->input('author');        // 作者/译者 (metadata.author)
-        $channel = $request->input('channel');       // 来源渠道 (metadata.channel)
-
-        // 确保数组类型参数正确解析(POST 时可能是 JSON 字符串)
-        $tags = is_array($tags) ? $tags : (is_string($tags) ? json_decode($tags, true) ?? [] : []);
-        $pageRefs = is_array($pageRefs) ? $pageRefs : (is_string($pageRefs) ? json_decode($pageRefs, true) ?? [] : []);
-
-        // 组装搜索参数
-        $params = [
-            'query' => $query,
-            'page' => $page,
-            'pageSize' => $pageSize,
-            'searchMode' => $searchMode,
-            'resourceType' => $resourceType,
-            'resourceId' => $resourceId,
-            'granularity' => $granularity,
-            'language' => $language,
-            'category' => $category,
-            'tags' => $tags,
-            'pageRefs' => $pageRefs,
-            'relatedId' => $relatedId,
-            'author' => $author,
-            'channel' => $channel,
-        ];
-
-        try {
-            // 调用 OpenSearchService 执行搜索
-            $result = $this->searchService->search($params);
-
-            return response()->json([
-                'success' => true,
-                'data' => $result,
-                'query_info' => [
-                    'original_query' => $query,
-                    'search_mode' => $searchMode,
-                    'request_method' => $request->method(), // 可选:返回请求方法
-                ],
-            ]);
-        } catch (\Exception $e) {
-            return response()->json([
-                'success' => false,
-                'error' => $e->getMessage(),
-            ], 500);
-        }
-    }
-
-    /**
-     * 全文检索(POST)
-     *
-     * 与 `GET /v3/search` 完全等价,只是把参数放在请求体里——参数多、
-     * 尤其是 page_refs / related_id 这类数组时,URL 放不下。
-     *
-     * @unauthenticated
-     *
-     * @bodyParam q string required 搜索关键词
-     * @bodyParam search_mode string 检索模式。Enum: fuzzy,exact,semantic,hybrid,definition Default: fuzzy
-     * @bodyParam resource_type string 资源类型
-     * @bodyParam granularity string 文档颗粒度
-     * @bodyParam language string 语言
-     * @bodyParam category string 文档分类,逗号分隔
-     * @bodyParam tags string 标签,逗号分隔
-     * @bodyParam page_refs array 页码标记
-     * @bodyParam related_id array 关联 id
-     * @bodyParam author string 作者或译者
-     * @bodyParam channel string 来源 channel
-     * @bodyParam page integer 页码。Default: 1
-     * @bodyParam page_size integer 每页数量,上限 100。Default: 20
-     */
-    public function store(Request $request)
-    {
-        // 直接调用 index 方法,复用搜索逻辑
-        return $this->index($request);
-    }
-
-    /**
-     * 按 id 取单条检索结果
-     *
-     * 直接从 OpenSearch 按文档 id 取回,不走检索。取不到返回 404。
-     *
-     * 整章正文文档(`tipitaka_chapter_{book}-{para}_{channel}`)按它所属 channel 判权限:
-     * 私有 channel 只有拥有者、团队成员、被共享的人能读(要带 token)。索引里收了所有 channel,
-     * 不在这里挡的话拼出 id 就能读到私有正文。
-     *
-     * @unauthenticated
-     *
-     * @urlParam search string required OpenSearch 文档 id
-     *
-     * @responseStatus 403 整章正文所属的 channel 是私有的,且当前身份看不见
-     */
-    public function show(Request $request, $id)
-    {
-        if (preg_match(self::CHAPTER_DOC, (string) $id, $m)) {
-            $this->abilities->assertReadable($m[1], $this->currentUserUid($request));
-        }
-        try {
-            return BaseResource::make(HitItemDTO::fromArray($this->searchService->get($id)));
-        } catch (\Throwable $th) {
-            abort(404, __('site.not_found'));
-        }
-    }
-}

+ 0 - 195
api-v13/app/Http/Controllers/V3/SearchSuggestController.php

@@ -1,195 +0,0 @@
-<?php
-
-// api-v8/app/Http/Controllers/SearchSuggestController.php
-
-namespace App\Http\Controllers\V3;
-
-use App\Http\Controllers\Controller;
-use App\Services\OpenSearchService;
-use Illuminate\Http\Request;
-
-/**
- * 搜索自动建议控制器
- *
- * 返回示例:
- *
- * 请求:GET /api/v3/search-suggest?q=dhamma&fields=title,content&limit=10
- *
- * 返回:
- * {
- *   "success": true,
- *   "data": {
- *     "query": "dhamma",
- *     "suggestions": [
-      {
-        "text": "dhammacakkapavattanasutta",
-        "source": "content",
-        "score": 1,
-        "resource_type": "term",
-        "language": "zh",
-        "doc_id": "term_69258244-bccd-40ed-bfaa-ddef4ae5ae4c",
-        "category": [],
-        "granularity": null
-      },
-      {
-        "text": "dhammacakkappavattanasutta",
-        "source": "content",
-        "score": 1,
-        "resource_type": "term",
-        "language": "zh-hans",
-        "doc_id": "term_bcb14399-ea80-4a8a-aeab-a4c927e45fdd",
-        "category": [],
-        "granularity": null
-      }
- *     ],
- *     "total": 2
- *   }
- * }
- */
-class SearchSuggestController extends Controller
-{
-    protected $searchService;
-
-    /**
-     * 构造函数,注入 OpenSearchService
-     */
-    public function __construct(OpenSearchService $searchService)
-    {
-        $this->searchService = $searchService;
-    }
-
-    /**
-     * # 1. 查询所有字段(默认)
-GET /api/v2/suggest?q=dhamma&limit=10
-
-# 2. 只查询标题
-GET /api/v2/suggest?q=dhamma&fields=title&limit=10
-
-# 3. 查询标题和内容
-GET /api/v2/suggest?q=dhamma&fields=title,content&limit=10
-
-# 4. 查询页面引用,带语言过滤
-GET /api/v2/suggest?q=M.1&fields=page_refs&language=pali&limit=5
-
-# 5. 数组形式传递多个字段
-GET /api/v2/suggest?q=dhamma&fields[]=title&fields[]=content&limit=10
-     */
-    /**
-     * 搜索建议(自动补全)
-     *
-     * 按前缀给出补全候选,供搜索框实时提示。每个字段各自返回一组建议。
-     * q 为空时返回 400。
-     *
-     * @unauthenticated
-     *
-     * @queryParam q string required 已输入的查询文本
-     * @queryParam fields string 在哪些字段上补全,逗号分隔;不传则全查。
-     *             Enum: title,content,page_refs
-     * @queryParam language string 语言过滤。Example: pali
-     * @queryParam limit integer 每个字段返回的建议数,上限 50。Default: 10
-     */
-    public function index(Request $request)
-    {
-        // 验证必填参数
-        $query = $request->input('q', '');
-        if (empty($query)) {
-            return response()->json([
-                'success' => false,
-                'error' => '缺少参数 q(查询文本)',
-            ], 400);
-        }
-
-        // 解析 fields 参数
-        $fields = $this->parseFields($request->input('fields'));
-
-        // 获取其他参数
-        $language = $request->input('language', null);
-        $limit = min(50, max(1, (int) $request->input('limit', 10)));
-
-        try {
-            // 调用搜索服务
-            $rawSuggestions = $this->searchService->suggest(
-                $query,
-                $fields,
-                $language,
-                $limit
-            );
-
-            // 格式化返回结果
-            $suggestions = $this->formatSuggestions($rawSuggestions);
-
-            return response()->json([
-                'success' => true,
-                'data' => [
-                    'query' => $query,
-                    'suggestions' => $suggestions,
-                    'total' => count($suggestions),
-                ],
-            ]);
-        } catch (\InvalidArgumentException $e) {
-            return response()->json([
-                'success' => false,
-                'error' => '无效的字段参数:'.$e->getMessage(),
-                'hint' => '有效的字段值:title, content, page_refs',
-            ], 400);
-        } catch (\Exception $e) {
-            return response()->json([
-                'success' => false,
-                'error' => '搜索建议失败:'.$e->getMessage(),
-            ], 500);
-        }
-    }
-
-    /**
-     * 解析 fields 参数
-     *
-     * @param  mixed  $fields
-     * @return string|array|null
-     */
-    protected function parseFields($fields)
-    {
-        if ($fields === null) {
-            return null;  // 查询所有字段
-        }
-
-        if (is_string($fields)) {
-            // 如果是逗号分隔的字符串,转换为数组
-            if (strpos($fields, ',') !== false) {
-                $fieldsArray = array_map('trim', explode(',', $fields));
-
-                return $fieldsArray;
-            }
-
-            // 单个字段
-            return $fields;
-        }
-
-        if (is_array($fields)) {
-            return $fields;
-        }
-
-        return null;
-    }
-
-    /**
-     * 格式化建议结果
-     */
-    protected function formatSuggestions(array $rawSuggestions): array
-    {
-        return collect($rawSuggestions)->map(function ($item) {
-            $docSource = $item['doc_source'] ?? [];
-
-            return [
-                'text' => $item['text'] ?? '',
-                'source' => $item['source'] ?? null,
-                'score' => round($item['score'] ?? 0, 2),
-                'resource_type' => $docSource['resource_type'] ?? null,
-                'language' => $docSource['language'] ?? null,
-                'doc_id' => $item['doc_id'] ?? null,
-                // 可选:添加更多元数据
-                'category' => $docSource['category'] ?? null,
-                'granularity' => $docSource['granularity'] ?? null,
-            ];
-        })->all();
-    }
-}

+ 44 - 0
api-v13/app/Http/Controllers/V3/SearchSuggestionController.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexSearchSuggestionRequest;
+use App\Http\Resources\V3\SearchSuggestionResource;
+use App\Services\V3\SearchService;
+
+/**
+ * 搜索建议(搜索框的前缀补全,OpenSearch completion suggester)
+ *
+ * 取代早期的 `GET /v3/search-suggest`(`V3\SearchSuggestController`,2026-11-19 删除):
+ * 路径复数化;`{success, data:{query, suggestions, total}}` 改成 `{data, meta}`;空 q 从 400 改 422;
+ * `limit` 从「每个字段各取」改成总条数并去重;去掉从未生效的 `language` 参数。
+ * 无对应的 v2 端点。
+ */
+class SearchSuggestionController extends Controller
+{
+    public function __construct(private readonly SearchService $search) {}
+
+    /**
+     * 搜索建议
+     *
+     * 按已输入的前缀给出补全候选,各字段合并后按分数排序、同一个词只出现一次。
+     * 搜索服务连不上或超时回 503(`search-unavailable`)。
+     *
+     * @unauthenticated
+     *
+     * @queryParam q string required 已输入的前缀
+     * @queryParam fields string 在哪些字段上补全,逗号分隔,可选 title_pali、title_zh、content_pali、content_zh;不传则全部。Example: title_pali,content_pali
+     * @queryParam limit integer 最多返回几条,上限 50。Default: 10
+     *
+     * @responseStatus 503 搜索服务暂不可用
+     *
+     * @meta total integer 本次返回的条数
+     */
+    public function __invoke(IndexSearchSuggestionRequest $request)
+    {
+        $items = $this->search->suggest($request->validated());
+
+        return SearchSuggestionResource::collection($items)->additional(['meta' => ['total' => count($items)]]);
+    }
+}

+ 42 - 0
api-v13/app/Http/Controllers/V3/TipitakaPageNumberController.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexTipitakaPageNumberRequest;
+use App\Http\Resources\V3\TipitakaPageNumberResource;
+use App\Services\V3\TipitakaPageNumberService;
+
+/**
+ * 按印本页码找三藏段落(只读、公开)。
+ *
+ * 取代 `GET /v2/search-page-number/{number}`(`SearchPageNumberController@show`),以及 v2
+ * `search?view=page` 的「卷.页」查法。v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ */
+class TipitakaPageNumberController extends Controller
+{
+    public function __construct(private readonly TipitakaPageNumberService $pages) {}
+
+    /**
+     * 按页码找段落
+     *
+     * 一个页码在 PTS、缅甸版、VRI、泰国版、其他里各指一处或多处,另有 CS 版印的段落号(`edition=CS`)。
+     * 返回全部命中(不分页,通常几百条),按版本、书、卷、段排序。每条带书名、层级与该版本的书名。
+     * 卷号未知的记录 `volume` 为 null;给了 `volume` 就只要这一卷(CS 段落号不分卷,不返回)。
+     *
+     * @unauthenticated
+     *
+     * @urlParam page integer required 页码(或 CS 段落号)。Example: 100
+     *
+     * @queryParam edition string 只要这个版本。Enum: PTS,My,VRI,Thai,Other,CS
+     * @queryParam volume integer 只要这一卷。Example: 2
+     *
+     * @meta total integer 命中数
+     */
+    public function __invoke(IndexTipitakaPageNumberRequest $request, int $page)
+    {
+        $rows = $this->pages->find($page, $request->filters());
+
+        return TipitakaPageNumberResource::collection($rows)->additional(['meta' => ['total' => count($rows)]]);
+    }
+}

+ 10 - 7
api-v13/app/Http/Controllers/V3/TipitakaChapterController.php → 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),

+ 45 - 0
api-v13/app/Http/Controllers/V3/TipitakaWordParagraphAggregateController.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\AggregateTipitakaWordParagraphRequest;
+use App\Http\Resources\V3\TipitakaWordBookResource;
+use App\Services\V3\TipitakaWordParagraphService;
+
+/**
+ * 按词形检索的出处分布(只读、公开)。
+ *
+ * 取代 `GET /v2/search-pali-wbw-books`(`SearchPaliWbwController@book_list`)。
+ * v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ */
+class TipitakaWordParagraphAggregateController extends Controller
+{
+    public function __construct(private readonly TipitakaWordParagraphService $paragraphs) {}
+
+    /**
+     * 按书统计命中
+     *
+     * 与 `GET /v3/tipitaka-word-paragraphs` 同样的检索条件,按书汇总:每本书命中多少段、多少词次,
+     * 按段落数降序,不分页。v2 只给词次;同一段里出现多次只算一段,所以两者不相等。
+     *
+     * @unauthenticated
+     *
+     * @queryParam words string required 词形,逗号分隔,最多 200 个。Example: vitakko,vitakkaṃ
+     * @queryParam bold string 只看黑体(only)或排除黑体(exclude);不给则不限。Enum: only,exclude
+     *
+     * @meta total integer 书的数目
+     * @meta paragraphs integer 命中段落总数
+     * @meta occurrences integer 词次总数
+     */
+    public function __invoke(AggregateTipitakaWordParagraphRequest $request)
+    {
+        $result = $this->paragraphs->books($request->criteria());
+
+        return TipitakaWordBookResource::collection($result['items'])->additional(['meta' => [
+            'total' => count($result['items']),
+            'paragraphs' => $result['paragraphs'],
+            'occurrences' => $result['occurrences'],
+        ]]);
+    }
+}

+ 41 - 0
api-v13/app/Http/Controllers/V3/TipitakaWordParagraphController.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Http\Controllers\V3;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\V3\IndexTipitakaWordParagraphRequest;
+use App\Http\Resources\V3\TipitakaWordParagraphResource;
+use App\Services\V3\TipitakaWordParagraphService;
+
+/**
+ * 按词形找三藏段落(只读、公开)。
+ *
+ * 取代 `GET|POST /v2/search-pali-wbw`(`SearchPaliWbwController@index` / `@store`)。
+ * v2 那份在 dashboard-v4 下线前原样保留,不要改动。
+ */
+class TipitakaWordParagraphController extends Controller
+{
+    public function __construct(private readonly TipitakaWordParagraphService $paragraphs) {}
+
+    /**
+     * 按词形找段落
+     *
+     * 在逐词表里精确匹配词形(连音已拆开),返回命中的段落,按命中权重降序、同分按经文顺序。
+     * 词形先用 `GET /v3/pali-word-forms/{word}` 展开——拿词根直接查通常是 0 条。
+     * 每条带整段正文(只含 `<b>` 黑体与 `<mark>` 命中词的安全 HTML)、章节路径与各印本页码。
+     *
+     * @unauthenticated
+     *
+     * @queryParam words string required 词形,逗号分隔,最多 200 个。Example: vitakko,vitakkaṃ
+     * @queryParam bold string 只看黑体(only,注释书里被解释的词)或排除黑体(exclude);不给则不限。Enum: only,exclude
+     * @queryParam book_id string 只看这些书,逗号分隔的 book_id(见 `/aggregate`)。Example: 75,79
+     * @queryParam page integer 页码。Default: 1
+     * @queryParam per_page integer 每页条数,上限 100。Default: 20
+     */
+    public function index(IndexTipitakaWordParagraphRequest $request)
+    {
+        return TipitakaWordParagraphResource::collection(
+            $this->paragraphs->paragraphs($request->criteria(), (int) $request->validated('per_page', 20)),
+        );
+    }
+}

+ 69 - 0
api-v13/app/Http/Requests/V3/AggregateTipitakaWordParagraphRequest.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/tipitaka-word-paragraphs/aggregate`:按书统计命中。
+ *
+ * 也是列表端点 `IndexTipitakaWordParagraphRequest` 的基类——两者的检索条件相同,
+ * 列表另有书的过滤与分页。
+ */
+class AggregateTipitakaWordParagraphRequest extends FormRequest
+{
+    /** 一次最多查多少个词形(一个常见词根展开后通常几十个) */
+    public const MAX_WORDS = 200;
+
+    public const BOLD = ['only', 'exclude'];
+
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'words' => ['required', 'string', 'max:6000', function (string $attribute, mixed $value, \Closure $fail): void {
+                $count = count(self::splitWords((string) $value));
+                if ($count === 0) {
+                    $fail(__('validation.required', ['attribute' => $attribute]));
+                } elseif ($count > self::MAX_WORDS) {
+                    $fail(__('validation.max.array', ['attribute' => $attribute, 'max' => self::MAX_WORDS]));
+                }
+            }],
+            'bold' => ['sometimes', 'string', 'in:'.implode(',', self::BOLD)],
+        ];
+    }
+
+    /**
+     * 逗号分隔的词形 → 去空白、去空项、去重。
+     *
+     * 空串绝不能进查询:`real` 为空的行有四百多万,覆盖几十万个段落。
+     *
+     * @return list<string>
+     */
+    public static function splitWords(string $value): array
+    {
+        $words = array_map('trim', explode(',', $value));
+
+        return array_values(array_unique(array_filter($words, fn (string $w): bool => $w !== '')));
+    }
+
+    /**
+     * Service 用的检索条件。
+     *
+     * @return array{words: list<string>, bold: string|null}
+     */
+    public function criteria(): array
+    {
+        return [
+            'words' => self::splitWords((string) $this->validated('words')),
+            'bold' => $this->validated('bold'),
+        ];
+    }
+}

+ 27 - 0
api-v13/app/Http/Requests/V3/IndexPaliWordSuggestionRequest.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/pali-word-suggestions`:巴利词的前缀补全。
+ */
+class IndexPaliWordSuggestionRequest extends FormRequest
+{
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'q' => ['required', 'string', 'max:64'],
+            'limit' => ['sometimes', 'integer', 'min:1', 'max:50'],
+        ];
+    }
+}

+ 89 - 0
api-v13/app/Http/Requests/V3/IndexSearchRequest.php

@@ -0,0 +1,89 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Illuminate\Foundation\Http\FormRequest;
+use Illuminate\Validation\Validator;
+
+/**
+ * `GET /v3/search` 与 `POST /v3/search`(两者等价,POST 把同样的参数放进请求体)。
+ *
+ * 枚举取的是索引里真实存在的值(IndexTipitaka / TermIndexService 写入的),
+ * 不是旧文档里那套对不上号的名字。
+ */
+class IndexSearchRequest extends FormRequest
+{
+    public const MODES = ['fuzzy', 'exact', 'semantic', 'hybrid', 'definition'];
+
+    public const RESOURCE_TYPES = ['tipitaka', 'original_text', 'term'];
+
+    public const GRANULARITIES = ['book', 'chapter', 'session', 'paragraph'];
+
+    /** OpenSearch 的 index.max_result_window:from + size 超过它直接报错 */
+    public const MAX_WINDOW = 10000;
+
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * JSON 请求体里的 true / false 是布尔值,查询串里是字符串,统一成字符串再校验。
+     */
+    protected function prepareForValidation(): void
+    {
+        if (is_bool($this->input('facets'))) {
+            $this->merge(['facets' => $this->input('facets') ? 'true' : 'false']);
+        }
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'q' => ['required', 'string', 'max:500'],
+            'search_mode' => ['sometimes', 'string', 'in:'.implode(',', self::MODES)],
+            'resource_type' => ['sometimes', 'string', 'in:'.implode(',', self::RESOURCE_TYPES)],
+            'resource_id' => ['sometimes', 'string', 'max:255'],
+            'granularity' => ['sometimes', 'string', 'in:'.implode(',', self::GRANULARITIES)],
+            'language' => ['sometimes', 'string', 'max:16'],
+            'category' => ['sometimes', 'string', 'max:500'],
+            'tags' => ['sometimes', 'string', 'max:500'],
+            'page_refs' => ['sometimes', 'array', 'max:50'],
+            'page_refs.*' => ['string', 'max:64'],
+            'related_id' => ['sometimes', 'array', 'max:50'],
+            'related_id.*' => ['string', 'max:255'],
+            'author' => ['sometimes', 'string', 'max:255'],
+            'channel' => ['sometimes', 'uuid'],
+            'facets' => ['sometimes', 'in:true,false,1,0'],
+            'page' => ['sometimes', 'integer', 'min:1'],
+            'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
+        ];
+    }
+
+    /**
+     * 翻页深度受 OpenSearch 限制:超出时在这里给 422,而不是让 OpenSearch 报错变成 500。
+     *
+     * @return array<int, callable>
+     */
+    public function after(): array
+    {
+        return [
+            function (Validator $validator): void {
+                if ($validator->errors()->isNotEmpty()) {
+                    return;
+                }
+                $page = (int) $this->input('page', 1);
+                $perPage = (int) $this->input('per_page', 20);
+                if ($page * $perPage > self::MAX_WINDOW) {
+                    $validator->errors()->add('page', __('validation.max.numeric', [
+                        'attribute' => 'page',
+                        'max' => intdiv(self::MAX_WINDOW, $perPage),
+                    ]));
+                }
+            },
+        ];
+    }
+}

+ 50 - 0
api-v13/app/Http/Requests/V3/IndexSearchSuggestionRequest.php

@@ -0,0 +1,50 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use Closure;
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/search-suggestions`:搜索框的前缀补全。
+ */
+class IndexSearchSuggestionRequest extends FormRequest
+{
+    /** 可补全的字段(OpenSearchService::suggest 的字段标识符) */
+    public const FIELDS = ['title_pali', 'title_zh', 'content_pali', 'content_zh'];
+
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return [
+            'q' => ['required', 'string', 'max:100'],
+            'fields' => ['sometimes', 'string', 'max:100', function (string $attribute, mixed $value, Closure $fail): void {
+                $unknown = array_diff(self::splitFields((string) $value), self::FIELDS);
+                if ($unknown !== [] || self::splitFields((string) $value) === []) {
+                    $fail(__('validation.in', ['attribute' => $attribute]));
+                }
+            }],
+            'limit' => ['sometimes', 'integer', 'min:1', 'max:50'],
+        ];
+    }
+
+    /**
+     * 逗号分隔的字段列表,去空白、去空项、去重。
+     *
+     * @return list<string>
+     */
+    public static function splitFields(string $value): array
+    {
+        return array_values(array_unique(array_filter(
+            array_map('trim', explode(',', $value)),
+            fn (string $field) => $field !== '',
+        )));
+    }
+}

+ 46 - 0
api-v13/app/Http/Requests/V3/IndexTipitakaPageNumberRequest.php

@@ -0,0 +1,46 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+use App\Services\V3\TipitakaPageNumberService;
+use Illuminate\Foundation\Http\FormRequest;
+
+/**
+ * `GET /v3/tipitaka-page-numbers/{page}`:版本与卷号都是可选过滤。
+ */
+class IndexTipitakaPageNumberRequest extends FormRequest
+{
+    public function authorize(): bool
+    {
+        return true;
+    }
+
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        $editions = [...array_values(TipitakaPageNumberService::EDITIONS), TipitakaPageNumberService::CS];
+
+        return [
+            'edition' => ['sometimes', 'string', 'in:'.implode(',', $editions)],
+            'volume' => ['sometimes', 'integer', 'min:1', 'max:99'],
+        ];
+    }
+
+    /**
+     * @return array{edition?: string, volume?: int}
+     */
+    public function filters(): array
+    {
+        $filters = [];
+        if ($this->has('edition')) {
+            $filters['edition'] = (string) $this->validated('edition');
+        }
+        if ($this->has('volume')) {
+            $filters['volume'] = (int) $this->validated('volume');
+        }
+
+        return $filters;
+    }
+}

+ 2 - 2
api-v13/app/Http/Requests/V3/IndexTipitakaChapterRequest.php → 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'];

+ 33 - 0
api-v13/app/Http/Requests/V3/IndexTipitakaWordParagraphRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Http\Requests\V3;
+
+/**
+ * `GET /v3/tipitaka-word-paragraphs`:按词形找段落。检索条件同聚合端点,另加书的过滤与分页。
+ */
+class IndexTipitakaWordParagraphRequest extends AggregateTipitakaWordParagraphRequest
+{
+    /**
+     * @return array<string, array<int, mixed>>
+     */
+    public function rules(): array
+    {
+        return parent::rules() + [
+            'book_id' => ['sometimes', 'string', 'regex:/^\d+(,\d+)*$/', 'max:2000'],
+            'page' => ['sometimes', 'integer', 'min:1'],
+            'per_page' => ['sometimes', 'integer', 'min:1', 'max:100'],
+        ];
+    }
+
+    /**
+     * @return array{words: list<string>, bold: string|null, book_ids: list<int>}
+     */
+    public function criteria(): array
+    {
+        $bookIds = $this->validated('book_id');
+
+        return parent::criteria() + [
+            'book_ids' => $bookIds === null ? [] : array_values(array_unique(array_map('intval', explode(',', $bookIds)))),
+        ];
+    }
+}

+ 3 - 0
api-v13/app/Http/Resources/ArticleResource.php

@@ -143,6 +143,9 @@ class ArticleResource extends JsonResource
                 }
             }
             if (count($channels) === 0) {
+                // FIXME: ->get() 返回的集合永远为真,作者名下没有译文 channel 时 $studioChannel[0] 直接报错
+                // (Undefined array key 0 → 500,文集阅读页与 v2 文章接口都会中);下面的系统 channel 回退分支
+                // 永远走不到。迁 article 到 v3 时修:用 ->value('uid') 判空,取不到再回退系统 channel。
                 // 查找用户默认channel
                 $studioChannel = Channel::where('owner_uid', $this->owner)
                     ->where('type', 'translation')

+ 27 - 0
api-v13/app/Http/Resources/V3/PaliWordFormResource.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 一个词根及其在三藏里出现过的词形(`word_indices` 表的计数)。
+ *
+ * `count` 是该词形的总出现次数,`bold` 是其中以黑体出现的次数(注释书里被解释的词)。
+ */
+class PaliWordFormResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     base: string,
+     *     forms: list<array{word: string, count: int, bold: int}>
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return [
+            'base' => (string) $this['base'],
+            'forms' => $this['forms'],
+        ];
+    }
+}

+ 25 - 0
api-v13/app/Http/Resources/V3/PaliWordSuggestionResource.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 一个补全候选:三藏里出现过的词形(`word_indices`)。
+ *
+ * `count` 是总出现次数,`bold` 是其中以黑体出现的次数(注释书里被解释的词)。
+ */
+class PaliWordSuggestionResource extends BaseResource
+{
+    /**
+     * @return array{word: string, count: int, bold: int}
+     */
+    public function toArray(Request $request): array
+    {
+        return [
+            'word' => $this['word'],
+            'count' => $this['count'],
+            'bold' => $this['bold'],
+        ];
+    }
+}

+ 38 - 0
api-v13/app/Http/Resources/V3/SearchHitResource.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 一条检索命中(OpenSearch 文档归一化后的结构,见 `App\Services\V3\SearchService::hit()`)。
+ *
+ * `related_id` 对经文段落是 `{book}-{para}` 坐标;`display` 只在按 id 取单条时才有(阅读用的 HTML)。
+ */
+class SearchHitResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     id: string,
+     *     resource_type: string,
+     *     resource_id: string|null,
+     *     granularity: string|null,
+     *     language: string|null,
+     *     related_id: string|null,
+     *     score: float|null,
+     *     title: string,
+     *     content: string,
+     *     highlight: string|null,
+     *     bold: list<string>,
+     *     path: string|null,
+     *     category: list<string>,
+     *     tags: list<string>,
+     *     updated_at: string|null,
+     *     display?: string
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return $this->resource;
+    }
+}

+ 30 - 0
api-v13/app/Http/Resources/V3/SearchSuggestionResource.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 一条搜索建议(OpenSearch completion 候选,见 `App\Services\V3\SearchService::suggest()`)。
+ *
+ * `source` 是候选来自哪个补全字段;`doc_id` 是候选所在的检索文档,可直接 `GET /v3/search/{doc_id}`。
+ */
+class SearchSuggestionResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     text: string,
+     *     source: string,
+     *     score: float,
+     *     doc_id: string|null,
+     *     resource_type: string|null,
+     *     language: string|null,
+     *     granularity: string|null,
+     *     category: list<string>
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return $this->resource;
+    }
+}

+ 49 - 0
api-v13/app/Http/Resources/V3/TipitakaPageNumberResource.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 一处印本页码(或 CS 段落号)在三藏里的位置。
+ *
+ * `edition`:PTS / My(缅甸第六次结集版)/ VRI / Thai / Other / CS(CS 版印的段落号)。
+ * `volume` 为 null 表示卷号未知(库里记作 0)或不分卷(CS)。`book` / `para` 是页码标记所在段落;
+ * `book_id` 是 `pcd_book_id`,`book_title` 是书名,`book_para` 是书名所在段(CS 段落号按书编号,定位要用它)。
+ * `edition_title` 是该版本的书名(静态书名表,PTS / 缅 / VRI 各有一套,其余用通用名;CS 为 null),
+ * v6 的印本页阅读页按「版本_版本书名_卷_页」定位。`tags` 是书的 tag(同 tipitaka-word-paragraphs/aggregate),客户端按它做目录过滤。
+ */
+class TipitakaPageNumberResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     edition: string,
+     *     volume: int|null,
+     *     page: int,
+     *     book: int,
+     *     para: int,
+     *     book_id: int,
+     *     book_title: string,
+     *     book_para: int,
+     *     edition_title: string|null,
+     *     layer: string|null,
+     *     tags: list<string>
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return [
+            'edition' => $this['edition'],
+            'volume' => $this['volume'],
+            'page' => $this['page'],
+            'book' => $this['book'],
+            'para' => $this['para'],
+            'book_id' => $this['book_id'],
+            'book_title' => $this['book_title'],
+            'book_para' => $this['book_para'],
+            'edition_title' => $this['edition_title'],
+            'layer' => $this['layer'],
+            'tags' => $this['tags'],
+        ];
+    }
+}

+ 3 - 3
api-v13/app/Http/Resources/V3/TipitakaChapterResource.php → 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

+ 41 - 0
api-v13/app/Http/Resources/V3/TipitakaWordBookResource.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 按词形检索的一本书的命中统计。
+ *
+ * `book_id` 是 `pcd_book_id`(`book_titles.sn`),也是列表端点 `book_id` 过滤用的值;
+ * `book` / `para` 是书名所在段的坐标。`paragraphs` 是命中段落数,`occurrences` 是词次
+ * (同一段出现多次算多次)。`layer` 取自书的 tag(mula / atthakatha / tika / anna),没有则为 null。
+ */
+class TipitakaWordBookResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     book_id: int,
+     *     book: int,
+     *     para: int,
+     *     title: string,
+     *     layer: string|null,
+     *     tags: list<string>,
+     *     paragraphs: int,
+     *     occurrences: int
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return [
+            'book_id' => $this['book_id'],
+            'book' => $this['book'],
+            'para' => $this['para'],
+            'title' => $this['title'],
+            'layer' => $this['layer'],
+            'tags' => $this['tags'],
+            'paragraphs' => $this['paragraphs'],
+            'occurrences' => $this['occurrences'],
+        ];
+    }
+}

+ 45 - 0
api-v13/app/Http/Resources/V3/TipitakaWordParagraphResource.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Http\Resources\V3;
+
+use Illuminate\Http\Request;
+
+/**
+ * 按词形命中的一个三藏段落(`wbw_templates` 按段聚合 + `pali_texts` + `page_numbers`)。
+ *
+ * `text` 是整段正文的安全 HTML:只有 `<b>`(原文黑体,即注释书里被解释的词)与 `<mark>`(命中的词形),
+ * 其余全部已转义,可直接渲染。`refs` 是各印本页码(每种版本取段内第一个),最后一条 `WP` 是 WikiPali
+ * 段落号;`title` 是丛书缩写(缅甸版、PTS、WP 才有)。
+ */
+class TipitakaWordParagraphResource extends BaseResource
+{
+    /**
+     * @return array{
+     *     id: string,
+     *     book: int,
+     *     para: int,
+     *     score: int,
+     *     hits: int,
+     *     title: string,
+     *     level: int,
+     *     path: list<array{book: int, para: int, title: string, level: int}>,
+     *     text: string,
+     *     refs: list<array{type: string, volume: int|null, page: int, title: string|null}>
+     * }
+     */
+    public function toArray(Request $request): array
+    {
+        return [
+            'id' => "{$this['book']}-{$this['para']}",
+            'book' => $this['book'],
+            'para' => $this['para'],
+            'score' => $this['score'],
+            'hits' => $this['hits'],
+            'title' => $this['title'],
+            'level' => $this['level'],
+            'path' => $this['path'],
+            'text' => $this['text'],
+            'refs' => $this['refs'],
+        ];
+    }
+}

+ 22 - 8
api-v13/app/Services/OpenSearchService.php

@@ -431,9 +431,10 @@ class OpenSearchService
      * @type string $category           按分类过滤
      * @type array $tags               按标签过滤(terms)
      * @type array $pageRefs           按页码引用过滤(terms)
-     * @type string $relatedId          按关联 ID 过滤
+     * @type string|array $relatedId    按关联 ID 过滤(数组时命中任一)
      * @type string $author             按作者过滤
-     * @type string $channel            按频道过滤
+     * @type string $channel            按频道过滤(channel uuid)
+     * @type bool $aggregations       是否计算分面聚合,默认 true
      * @type array $highlight_pre_tags 高亮前置标签,默认 ['<mark>']
      * @type array $highlight_post_tags 高亮后置标签,默认 ['</mark>']
      *             }
@@ -497,15 +498,19 @@ class OpenSearchService
         }
 
         if (! empty($params['relatedId'])) {
-            $filters[] = ['term' => ['related_id' => $params['relatedId']]];
+            $filters[] = is_array($params['relatedId'])
+                ? ['terms' => ['related_id' => array_values($params['relatedId'])]]
+                : ['term' => ['related_id' => $params['relatedId']]];
         }
 
         if (! empty($params['author'])) {
             $filters[] = ['match' => ['metadata.author' => $params['author']]];
         }
 
+        // metadata.channel 在映射里是 text(标准分词器会把 uuid 按连字符拆开),
+        // term 拿整个 uuid 去比永远对不上,只能按短语匹配
         if (! empty($params['channel'])) {
-            $filters[] = ['term' => ['metadata.channel' => $params['channel']]];
+            $filters[] = ['match_phrase' => ['metadata.channel' => $params['channel']]];
         }
 
         // ---------- 查询部分 ----------
@@ -560,7 +565,10 @@ class OpenSearchService
                     ],
                 ]
                 : $query,
-            'aggs' => [
+        ];
+
+        if ($params['aggregations'] ?? true) {
+            $dsl['aggs'] = [
                 'resource_type' => [
                     'terms' => ['field' => 'resource_type'],
                 ],
@@ -573,8 +581,8 @@ class OpenSearchService
                 'granularity' => [
                     'terms' => ['field' => 'granularity'],
                 ],
-            ],
-        ];
+            ];
+        }
 
         // 只有有搜索词时才开启高亮;字段按语种路由,避免把巴利文喂给中文分词器
         if ($queryText !== '') {
@@ -1355,8 +1363,14 @@ class OpenSearchService
             ];
         }
 
-        $dsl = ['suggest' => $suggests];
+        // 每条候选只带出处的元数据,不把整篇文档(正文、向量)拉回来
+        $dsl = [
+            '_source' => ['resource_type', 'language', 'granularity', 'category'],
+            'suggest' => $suggests,
+        ];
 
+        // FIXME: completion suggester 会忽略 query,这个语言过滤从来没生效过(v3 已不再传)。
+        // 真要按语言过滤得给 *.suggest.* 字段配 completion context 并重建索引。
         if ($language) {
             $dsl['query'] = ['term' => ['language' => $language]];
         }

+ 85 - 0
api-v13/app/Services/V3/PaliWordFormService.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\WordIndex;
+use App\Tools\CaseEnding;
+use App\Tools\CaseMan;
+
+/**
+ * 巴利词形展开:一个词 → 它可能的词根 → 每个词根在三藏里实际出现过的词形(含连音 iti / api / ca / hi)。
+ *
+ * 词根推导用共享的 `CaseMan::WordToBase(..., verify: false)`(纯字符串运算,不查库);
+ * 由词根生成词形的规则与 v2 `CaseMan::BaseToWord` 相同,但 v2 每个候选词形单独查一次
+ * `word_indices`(一个词上百次),这里先生成全部候选,再一次 whereIn 取出现次数。
+ */
+class PaliWordFormService
+{
+    /** 词尾表里低于这个置信度的规则不用(与 v2 /case 相同) */
+    private const CONFIDENCE = 0.2;
+
+    public function __construct(private readonly CaseMan $caseMan) {}
+
+    /**
+     * @return list<array{base: string, forms: list<array{word: string, count: int, bold: int}>}>
+     */
+    public function groups(string $word): array
+    {
+        $word = mb_strtolower(trim($word), 'UTF-8');
+
+        // 输入的词本身排第一组,其后是推导出的词根
+        $bases = array_values(array_unique([$word, ...array_map('strval', array_keys($this->caseMan->WordToBase($word, 1, false)))]));
+
+        $candidates = [];
+        foreach ($bases as $base) {
+            $candidates[$base] = $this->candidates($base);
+        }
+
+        $all = array_values(array_unique(array_merge(...array_values($candidates))));
+        $counts = $all === []
+            ? collect()
+            : WordIndex::whereIn('word', $all)->get(['word', 'count', 'bold'])->keyBy('word');
+
+        $groups = [];
+        foreach ($candidates as $base => $words) {
+            $forms = [];
+            foreach ($words as $form) {
+                if ($row = $counts->get($form)) {
+                    $forms[] = ['word' => $form, 'count' => (int) $row->count, 'bold' => (int) $row->bold];
+                }
+            }
+            if ($forms === []) {
+                continue;
+            }
+            usort($forms, fn (array $a, array $b) => $b['count'] <=> $a['count'] ?: strcmp($a['word'], $b['word']));
+            $groups[] = ['base' => (string) $base, 'forms' => $forms];
+        }
+
+        return $groups;
+    }
+
+    /**
+     * 由词根按词尾表生成候选词形,再对每个词形套连音规则。
+     *
+     * @return list<string>
+     */
+    private function candidates(string $base): array
+    {
+        $table = new CaseEnding;
+        $words = [];
+        foreach ($table->ending as [$from, $to, , , $confidence]) {
+            if ($confidence < self::CONFIDENCE || ! str_ends_with($base, $from)) {
+                continue;
+            }
+            $word = mb_substr($base, 0, mb_strlen($base, 'UTF-8') - mb_strlen($from, 'UTF-8'), 'UTF-8').$to;
+            $words[$word] = true;
+            foreach ($table->union as [$end, $joined]) {
+                if (str_ends_with($word, $end)) {
+                    $words[mb_substr($word, 0, mb_strlen($word, 'UTF-8') - mb_strlen($end, 'UTF-8'), 'UTF-8').$joined] = true;
+                }
+            }
+        }
+
+        return array_map('strval', array_keys($words));
+    }
+}

+ 38 - 0
api-v13/app/Services/V3/PaliWordSuggestionService.php

@@ -0,0 +1,38 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\WordIndex;
+use Illuminate\Contracts\Database\Eloquent\Builder;
+
+/**
+ * 巴利词的前缀补全(`word_indices`:三藏里出现过的每个词形及出现次数、黑体次数)。
+ *
+ * 前缀同时匹配原形与去变音形(`word_en`),所以不打变音符号也能补全(dhamma → dhammā)。
+ * 排序:与输入完全相同的词在前,其余按出现次数降序(v2 按词长排,短而罕见的词形挤掉常用词)。
+ */
+class PaliWordSuggestionService
+{
+    /**
+     * @return list<array{word: string, count: int, bold: int}>
+     */
+    public function suggest(string $prefix, int $limit): array
+    {
+        $prefix = mb_strtolower(trim($prefix), 'UTF-8');
+        $like = str_replace(['\\', '%', '_'], ['\\\\', '\\%', '\\_'], $prefix).'%';
+
+        return WordIndex::query()
+            ->where(fn (Builder $q) => $q->where('word', 'like', $like)->orWhere('word_en', 'like', $like))
+            ->orderByRaw('(word = ? or word_en = ?) desc', [$prefix, $prefix])
+            ->orderByDesc('count')
+            ->orderBy('word')
+            ->limit($limit)
+            ->get(['word', 'count', 'bold'])
+            ->map(fn (WordIndex $w) => [
+                'word' => (string) $w->word,
+                'count' => (int) $w->count,
+                'bold' => (int) $w->bold,
+            ])
+            ->all();
+    }
+}

+ 267 - 0
api-v13/app/Services/V3/SearchService.php

@@ -0,0 +1,267 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Exceptions\BusinessException;
+use App\Http\Requests\V3\IndexSearchRequest;
+use App\Http\Requests\V3\IndexSearchSuggestionRequest;
+use App\Services\OpenSearchService;
+use Closure;
+use OpenSearch\Exception\NotFoundHttpException;
+use OpenSearch\Exception\RequestTimeoutHttpException;
+use OpenSearch\Exception\ServiceUnavailableHttpException;
+use OpenSearch\Exception\TooManyRequestsHttpException;
+use Psr\Http\Client\ClientExceptionInterface;
+
+/**
+ * v3 全文检索与搜索建议:把 OpenSearch 的原始结果归一化成对外的扁平结构。
+ *
+ * 查询 DSL 仍由共享的 OpenSearchService 构造(Library 检索页与 AITermService 也在用),
+ * 这里只负责入参映射、异常分类和输出形状——不暴露 `_source` / `hits.hits` 这类 OpenSearch 内部结构。
+ *
+ * 异常分两类:
+ * - 搜索服务不可用(连不上、超时、集群过载)→ 503 `search-unavailable`,文案送达客户端,原异常写日志;
+ * - 其余(索引映射不对、DSL 写错)是真正的 bug → 原样抛出,兜底处理器回 500 并记日志。
+ */
+class SearchService
+{
+    /** 整章正文文档的 id:tipitaka_chapter_{book}-{para}_{channel uuid},见 IndexTipitaka */
+    private const CHAPTER_DOC = '/^tipitaka_chapter_\d+-\d+_([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i';
+
+    public function __construct(
+        private readonly OpenSearchService $search,
+        private readonly ChannelAbilityService $abilities,
+    ) {}
+
+    /**
+     * @param  array<string, mixed>  $input  IndexSearchRequest::validated()
+     * @return array{
+     *     items: list<array<string, mixed>>,
+     *     meta: array{current_page: int, per_page: int, total: int, total_relation: string, last_page: int, facets?: array<string, list<array{key: string, count: int}>>}
+     * }
+     */
+    public function search(array $input): array
+    {
+        $page = (int) ($input['page'] ?? 1);
+        $perPage = (int) ($input['per_page'] ?? 20);
+        $withFacets = in_array($input['facets'] ?? 'false', ['true', '1'], true);
+
+        $raw = $this->call(fn () => $this->search->search([
+            'query' => $input['q'],
+            'searchMode' => $input['search_mode'] ?? 'fuzzy',
+            'page' => $page,
+            'pageSize' => $perPage,
+            'resourceType' => $input['resource_type'] ?? null,
+            'resourceId' => $input['resource_id'] ?? null,
+            'granularity' => $input['granularity'] ?? null,
+            'language' => $input['language'] ?? null,
+            'category' => self::splitList($input['category'] ?? null) ?: null,
+            'tags' => self::splitList($input['tags'] ?? null),
+            'pageRefs' => array_values($input['page_refs'] ?? []),
+            'relatedId' => array_values($input['related_id'] ?? []) ?: null,
+            'author' => $input['author'] ?? null,
+            'channel' => $input['channel'] ?? null,
+            'aggregations' => $withFacets,
+        ]));
+
+        $total = (int) ($raw['hits']['total']['value'] ?? 0);
+        $meta = [
+            'current_page' => $page,
+            'per_page' => $perPage,
+            'total' => $total,
+            // OpenSearch 默认只精确计数到 10000,gte 表示「至少这么多」
+            'total_relation' => (string) ($raw['hits']['total']['relation'] ?? 'eq'),
+            'last_page' => max(1, min(
+                (int) ceil($total / $perPage),
+                intdiv(IndexSearchRequest::MAX_WINDOW, $perPage),
+            )),
+        ];
+        if ($withFacets) {
+            $meta['facets'] = self::facets($raw['aggregations'] ?? []);
+        }
+
+        return [
+            'items' => array_map(self::hit(...), $raw['hits']['hits'] ?? []),
+            'meta' => $meta,
+        ];
+    }
+
+    /**
+     * 按文档 id 取一条(带阅读用的 display HTML)。文档不存在 → 404。
+     *
+     * 整章正文文档按它所属 channel 判权限:索引里收了所有 channel,不在这里挡的话
+     * 拼出 id 就能读到私有正文。私有 channel 看不见 → 403。
+     *
+     * @return array<string, mixed>
+     */
+    public function find(string $id, ?string $viewerUid): array
+    {
+        if (preg_match(self::CHAPTER_DOC, $id, $m)) {
+            $this->abilities->assertReadable($m[1], $viewerUid);
+        }
+
+        try {
+            $raw = $this->call(fn () => $this->search->get($id));
+        } catch (NotFoundHttpException) {
+            abort(404, __('site.not_found'));
+        }
+
+        return self::hit($raw);
+    }
+
+    /**
+     * 搜索框的前缀补全。
+     *
+     * 各字段的候选合在一起按分数排,同一个词只留分数最高的一条,最多 limit 条
+     * (共享 Service 的 size 是按字段算的,这里每个字段取满 limit 再统一截断)。
+     *
+     * @param  array<string, mixed>  $input  IndexSearchSuggestionRequest::validated()
+     * @return list<array{text: string, source: string, score: float, doc_id: string|null, resource_type: string|null, language: string|null, granularity: string|null, category: list<string>}>
+     */
+    public function suggest(array $input): array
+    {
+        $limit = (int) ($input['limit'] ?? 10);
+        $fields = isset($input['fields'])
+            ? IndexSearchSuggestionRequest::splitFields($input['fields'])
+            : IndexSearchSuggestionRequest::FIELDS;
+
+        $raw = $this->call(fn () => $this->search->suggest($input['q'], $fields, null, $limit));
+
+        $items = [];
+        foreach ($raw as $option) {
+            $text = (string) ($option['text'] ?? '');
+            $key = mb_strtolower($text);
+            if ($text === '' || isset($items[$key])) {
+                continue;   // 已按分数降序,先到的分数最高
+            }
+            $source = $option['doc_source'] ?? [];
+            $items[$key] = [
+                'text' => $text,
+                'source' => (string) $option['source'],
+                'score' => round((float) ($option['score'] ?? 0), 2),
+                'doc_id' => isset($option['doc_id']) ? (string) $option['doc_id'] : null,
+                'resource_type' => isset($source['resource_type']) ? (string) $source['resource_type'] : null,
+                'language' => isset($source['language']) ? (string) $source['language'] : null,
+                'granularity' => isset($source['granularity']) ? (string) $source['granularity'] : null,
+                'category' => array_values((array) ($source['category'] ?? [])),
+            ];
+            if (count($items) >= $limit) {
+                break;
+            }
+        }
+
+        return array_values($items);
+    }
+
+    /**
+     * 调 OpenSearch,把「服务不可用」类异常转成 503。
+     *
+     * @template T
+     *
+     * @param  Closure(): T  $callback
+     * @return T
+     */
+    private function call(Closure $callback): mixed
+    {
+        try {
+            return $callback();
+        } catch (ClientExceptionInterface|ServiceUnavailableHttpException|RequestTimeoutHttpException|TooManyRequestsHttpException $e) {
+            report($e);
+
+            throw new BusinessException(__('site.search_unavailable'), 503, 'search-unavailable');
+        }
+    }
+
+    /**
+     * 一条 OpenSearch 命中(search 的 hit 或 get 的文档)→ 对外结构。
+     *
+     * 一条文档通常只有一种语言有值,title / content 把 text.* 下的非空值拼起来即可。
+     * 高亮优先取正文片段,没有再取标题。
+     *
+     * @param  array<string, mixed>  $hit
+     * @return array<string, mixed>
+     */
+    private static function hit(array $hit): array
+    {
+        $source = $hit['_source'] ?? [];
+        $highlight = $hit['highlight'] ?? [];
+        $fragment = null;
+        foreach (['content.text.pali', 'content.text.zh', 'summary.text', 'title.text.pali', 'title.text.zh'] as $field) {
+            if (! empty($highlight[$field][0])) {
+                $fragment = (string) $highlight[$field][0];
+                break;
+            }
+        }
+
+        $bold = $source['bold_single'] ?? [];
+        $bold = is_array($bold)
+            ? array_values(array_filter(array_map('strval', $bold), fn (string $v) => trim($v) !== ''))
+            : preg_split('/\s+/u', trim((string) $bold), -1, PREG_SPLIT_NO_EMPTY);
+
+        $item = [
+            'id' => (string) ($source['id'] ?? $hit['_id'] ?? ''),
+            'resource_type' => (string) ($source['resource_type'] ?? ''),
+            'resource_id' => isset($source['resource_id']) ? (string) $source['resource_id'] : null,
+            'granularity' => isset($source['granularity']) ? (string) $source['granularity'] : null,
+            'language' => isset($source['language']) ? (string) $source['language'] : null,
+            'related_id' => isset($source['related_id']) ? (string) $source['related_id'] : null,
+            'score' => isset($hit['_score']) ? (float) $hit['_score'] : null,
+            'title' => self::joinText($source['title']['text'] ?? []),
+            'content' => self::joinText($source['content']['text'] ?? []),
+            'highlight' => $fragment,
+            'bold' => $bold,
+            'path' => isset($source['path']) && $source['path'] !== '' ? (string) $source['path'] : null,
+            'category' => array_values((array) ($source['category'] ?? [])),
+            'tags' => array_values((array) ($source['tags'] ?? [])),
+            'updated_at' => isset($source['updated_at']) ? (string) $source['updated_at'] : null,
+        ];
+
+        if (isset($source['content']['display'])) {
+            $item['display'] = (string) $source['content']['display'];
+        }
+
+        return $item;
+    }
+
+    /**
+     * @param  mixed  $text  title.text / content.text(按语言分的对象)
+     */
+    private static function joinText(mixed $text): string
+    {
+        return implode('', array_filter(
+            is_array($text) ? array_values($text) : [],
+            fn ($v) => is_string($v) && $v !== '',
+        ));
+    }
+
+    /**
+     * @param  array<string, mixed>  $aggregations
+     * @return array<string, list<array{key: string, count: int}>>
+     */
+    private static function facets(array $aggregations): array
+    {
+        $facets = [];
+        foreach ($aggregations as $name => $agg) {
+            $facets[$name] = array_map(fn (array $bucket) => [
+                'key' => (string) $bucket['key'],
+                'count' => (int) $bucket['doc_count'],
+            ], $agg['buckets'] ?? []);
+        }
+
+        return $facets;
+    }
+
+    /**
+     * 逗号分隔的列表(category / tags),去空白、去空项。
+     *
+     * @return list<string>
+     */
+    private static function splitList(?string $value): array
+    {
+        if ($value === null) {
+            return [];
+        }
+
+        return array_values(array_filter(array_map('trim', explode(',', $value)), fn (string $v) => $v !== ''));
+    }
+}

+ 69 - 0
api-v13/app/Services/V3/TipitakaBookService.php

@@ -0,0 +1,69 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\BookTitle;
+use App\Models\PaliText;
+use Illuminate\Contracts\Database\Eloquent\Builder;
+use Illuminate\Support\Collection;
+
+/**
+ * 按 `pcd_book_id`(`book_titles.sn`)批量取书的基本信息:书名所在段、书名、tag、层级。
+ *
+ * 检索结果按书汇总时用(逐词检索的 /aggregate、页码检索),一次两条查询,不逐本查。
+ */
+class TipitakaBookService
+{
+    /** 书的 tag → layer(同 TipitakaTitleService),一本书有多个时按这个顺序取第一个 */
+    private const LAYER_TAGS = ['mūla' => 'mula', 'aṭṭhakathā' => 'atthakatha', 'ṭīkā' => 'tika', 'añña' => 'anna'];
+
+    /**
+     * 结果以 book_id 为键;book_titles 里没有的书不在其中。
+     *
+     * @param  iterable<int>  $bookIds  pcd_book_id
+     * @return Collection<int, array{book_id: int, book: int, para: int, title: string, layer: string|null, tags: list<string>}>
+     */
+    public function find(iterable $bookIds): Collection
+    {
+        $ids = collect($bookIds)->map(fn ($id) => (int) $id)->unique()->values();
+        if ($ids->isEmpty()) {
+            return collect();
+        }
+
+        $titles = BookTitle::whereIn('sn', $ids)->get(['sn', 'book', 'paragraph']);
+        if ($titles->isEmpty()) {
+            return collect();
+        }
+
+        $heads = PaliText::query()
+            ->where(function (Builder $q) use ($titles) {
+                foreach ($titles as $title) {
+                    $q->orWhere(fn (Builder $q) => $q->where('book', $title->book)->where('paragraph', $title->paragraph));
+                }
+            })
+            ->with('tagMaps.tags')
+            ->get(['uid', 'book', 'paragraph', 'toc'])
+            ->keyBy(fn (PaliText $t) => "{$t->book}-{$t->paragraph}");
+
+        return $titles->mapWithKeys(function (BookTitle $title) use ($heads) {
+            $head = $heads->get("{$title->book}-{$title->paragraph}");
+            $tags = $head ? $head->tagMaps->map(fn ($map) => $map->tags?->name)->filter()->map('strval')->values()->all() : [];
+            $layer = null;
+            foreach (self::LAYER_TAGS as $tag => $value) {
+                if (in_array($tag, $tags, true)) {
+                    $layer = $value;
+                    break;
+                }
+            }
+
+            return [(int) $title->sn => [
+                'book_id' => (int) $title->sn,
+                'book' => (int) $title->book,
+                'para' => (int) $title->paragraph,
+                'title' => (string) ($head?->toc ?? ''),
+                'layer' => $layer,
+                'tags' => $tags,
+            ]];
+        });
+    }
+}

+ 100 - 0
api-v13/app/Services/V3/TipitakaPageNumberService.php

@@ -0,0 +1,100 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Http\Api\BookTitle as EditionBookTitles;
+use App\Models\PageNumber;
+use App\Models\WbwTemplate;
+
+/**
+ * 按印本页码找三藏段落:PTS、缅甸第六次结集版、VRI、泰国版、其他,以及 CS 版印的段落号。
+ *
+ * 印本页码在 `page_numbers`(每条是正文里一个页码标记的位置);CS 段落号在逐词表里
+ * (`real = para{n}` 的词元)。一个页码在各版本里加起来最多约一千处,不分页。
+ */
+class TipitakaPageNumberService
+{
+    /** page_numbers.type 代号 → 对外的版本名(与 tipitaka-word-paragraphs 的 refs.type 一致) */
+    public const EDITIONS = ['P' => 'PTS', 'M' => 'My', 'V' => 'VRI', 'T' => 'Thai', 'O' => 'Other'];
+
+    /** CS 版印的段落号 */
+    public const CS = 'CS';
+
+    /** 版本 → 静态书名表里该版本的书名字段(v6 印本页阅读页按它定位,同 QuoteLinkLoader) */
+    private const TITLE_FIELDS = ['PTS' => 'p_title', 'My' => 'm_title', 'VRI' => 'v_title'];
+
+    public function __construct(private readonly TipitakaBookService $books) {}
+
+    /**
+     * @param  array{edition?: string, volume?: int}  $filters
+     * @return list<array{
+     *     edition: string, volume: int|null, page: int, book: int, para: int,
+     *     book_id: int, book_title: string, book_para: int, edition_title: string|null, layer: string|null, tags: list<string>
+     * }>
+     */
+    public function find(int $page, array $filters): array
+    {
+        $edition = $filters['edition'] ?? null;
+        $volume = $filters['volume'] ?? null;
+        $rows = [];
+
+        if ($edition !== self::CS) {
+            $types = $edition === null ? array_keys(self::EDITIONS) : [array_search($edition, self::EDITIONS, true)];
+            $pages = PageNumber::query()
+                ->where('page', $page)
+                ->whereIn('type', $types)
+                ->when($volume !== null, fn ($q) => $q->where('volume', $volume))
+                ->get(['type', 'volume', 'page', 'book', 'paragraph', 'pcd_book_id']);
+            foreach ($pages as $p) {
+                $rows[] = [
+                    'edition' => self::EDITIONS[$p->type],
+                    // 0 是「卷号未知」
+                    'volume' => (int) $p->volume ?: null,
+                    'page' => (int) $p->page,
+                    'book' => (int) $p->book,
+                    'para' => (int) $p->paragraph,
+                    'book_id' => (int) $p->pcd_book_id,
+                ];
+            }
+        }
+
+        // CS 段落号不分卷:给了卷号就不查
+        if (($edition === null || $edition === self::CS) && $volume === null) {
+            $paras = WbwTemplate::where('real', "para{$page}")->get(['book', 'paragraph', 'pcd_book_id']);
+            foreach ($paras as $p) {
+                $rows[] = [
+                    'edition' => self::CS,
+                    'volume' => null,
+                    'page' => $page,
+                    'book' => (int) $p->book,
+                    'para' => (int) $p->paragraph,
+                    'book_id' => (int) $p->pcd_book_id,
+                ];
+            }
+        }
+
+        $books = $this->books->find(array_column($rows, 'book_id'));
+        $editionTitles = collect(EditionBookTitles::get())->keyBy('id');
+
+        $rows = array_map(function (array $row) use ($books, $editionTitles) {
+            $book = $books->get($row['book_id']);
+            $titles = $editionTitles->get($row['book_id']);
+            $field = self::TITLE_FIELDS[$row['edition']] ?? 'term';
+
+            return $row + [
+                'book_title' => $book['title'] ?? '',
+                'book_para' => $book['para'] ?? 0,
+                'edition_title' => $row['edition'] === self::CS ? null : ($titles[$field] ?? null),
+                'layer' => $book['layer'] ?? null,
+                'tags' => $book['tags'] ?? [],
+            ];
+        }, $rows);
+
+        // 按版本(PTS、缅、VRI、泰、其他、CS)、书、卷、段排
+        $order = array_flip([...array_values(self::EDITIONS), self::CS]);
+        usort($rows, fn (array $a, array $b) => [$order[$a['edition']], $a['book_id'], $a['volume'] ?? 0, $a['book'], $a['para']]
+            <=> [$order[$b['edition']], $b['book_id'], $b['volume'] ?? 0, $b['book'], $b['para']]);
+
+        return $rows;
+    }
+}

+ 2 - 2
api-v13/app/Services/V3/TipitakaChapterService.php → 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;
 

+ 252 - 0
api-v13/app/Services/V3/TipitakaWordParagraphService.php

@@ -0,0 +1,252 @@
+<?php
+
+namespace App\Services\V3;
+
+use App\Models\PageNumber;
+use App\Models\PaliText;
+use App\Models\WbwTemplate;
+use App\Services\PaliSeriesesService;
+use Illuminate\Contracts\Database\Eloquent\Builder;
+use Illuminate\Pagination\LengthAwarePaginator;
+use Illuminate\Support\Collection;
+
+/**
+ * 按词形找三藏段落(逐词表 `wbw_templates`:连音已拆开,每个词形精确匹配)。
+ *
+ * 与 OpenSearch 全文检索(`/v3/search`)互补:这里召回精确到词形、能区分黑体(注释书里
+ * 被解释的词),但不做模糊、不做多词共现。
+ *
+ * v2 `search-pali-wbw` 每行另查 3~4 次库(段落、标题、页码、丛书缩写),这里整页批量取。
+ */
+class TipitakaWordParagraphService
+{
+    /** page_numbers.type 代号 → 对外的版本名(与 v2 ref.type 相同,插件按它拼出处) */
+    private const EDITIONS = ['M' => 'My', 'P' => 'PTS', 'V' => 'VRI', 'T' => 'Thai', 'O' => 'Other'];
+
+    public function __construct(
+        private readonly PaliSeriesesService $serieses,
+        private readonly TipitakaBookService $books,
+    ) {}
+
+    /**
+     * 命中段落,按命中权重降序(同分按经文顺序)。
+     *
+     * @param  array{words: list<string>, bold: string|null, book_ids: list<int>}  $criteria
+     * @return LengthAwarePaginator<int, array{
+     *     book: int, para: int, score: int, hits: int, title: string, level: int,
+     *     path: list<array{book: int, para: int, title: string, level: int}>,
+     *     text: string,
+     *     refs: list<array{type: string, volume: int|null, page: int, title: string|null}>
+     * }>
+     */
+    public function paragraphs(array $criteria, int $perPage): LengthAwarePaginator
+    {
+        $page = $this->matches($criteria)
+            ->when($criteria['book_ids'] !== [], fn (Builder $q) => $q->whereIn('pcd_book_id', $criteria['book_ids']))
+            ->groupBy(['book', 'paragraph'])
+            ->selectRaw('book, paragraph, sum(weight) as score, count(*) as hits')
+            ->orderByDesc('score')
+            ->orderBy('book')
+            ->orderBy('paragraph')
+            ->paginate($perPage);
+
+        $rows = collect($page->items());
+        $texts = $this->paliTexts($rows);
+        $refs = $this->pageNumbers($rows);
+        $highlighter = $this->highlighter($criteria['words']);
+
+        return $page->setCollection($rows->map(function ($row) use ($texts, $refs, $highlighter) {
+            $book = (int) $row->book;
+            $para = (int) $row->paragraph;
+            $text = $texts->get("{$book}-{$para}");
+            $path = self::path($text?->path);
+            $series = $this->serieses->find($book, $para);
+
+            return [
+                'book' => $book,
+                'para' => $para,
+                'score' => (int) $row->score,
+                'hits' => (int) $row->hits,
+                // 标题段(level < 100)用自己的标题,正文段用所在章节的标题
+                'title' => $text && $text->level < 100 ? (string) $text->toc : (string) (end($path)['title'] ?? ''),
+                'level' => (int) ($text?->level ?? 100),
+                'path' => $path,
+                'text' => $highlighter((string) ($text?->html ?? '')),
+                'refs' => [
+                    ...array_map(fn (array $r) => $r + ['title' => match ($r['type']) {
+                        'My' => $series['abbr_my'] ?? null,
+                        'PTS' => $series['abbr_pts'] ?? null,
+                        default => null,
+                    }], $refs->get("{$book}-{$para}", [])),
+                    ['type' => 'WP', 'volume' => null, 'page' => $para, 'title' => $series['abbr_wp'] ?? null],
+                ],
+            ];
+        }));
+    }
+
+    /**
+     * 按书统计:每本书(pcd_book_id)命中多少段、多少词次。按段落数降序。
+     *
+     * @param  array{words: list<string>, bold: string|null}  $criteria
+     * @return array{
+     *     items: list<array{book_id: int, book: int, para: int, title: string, layer: string|null, tags: list<string>, paragraphs: int, occurrences: int}>,
+     *     paragraphs: int,
+     *     occurrences: int
+     * }
+     */
+    public function books(array $criteria): array
+    {
+        $groups = $this->matches($criteria)
+            ->groupBy('pcd_book_id')
+            ->selectRaw('pcd_book_id, count(*) as occurrences, count(distinct (book, paragraph)) as paragraphs')
+            ->orderByDesc('paragraphs')
+            ->orderBy('pcd_book_id')
+            ->get();
+
+        $books = $this->books->find($groups->pluck('pcd_book_id'));
+
+        $items = $groups->map(function ($group) use ($books) {
+            $book = $books->get((int) $group->pcd_book_id);
+
+            return [
+                'book_id' => (int) $group->pcd_book_id,
+                'book' => $book['book'] ?? 0,
+                'para' => $book['para'] ?? 0,
+                'title' => $book['title'] ?? '',
+                'layer' => $book['layer'] ?? null,
+                'tags' => $book['tags'] ?? [],
+                'paragraphs' => (int) $group->paragraphs,
+                'occurrences' => (int) $group->occurrences,
+            ];
+        })->values()->all();
+
+        return [
+            'items' => $items,
+            'paragraphs' => array_sum(array_column($items, 'paragraphs')),
+            'occurrences' => array_sum(array_column($items, 'occurrences')),
+        ];
+    }
+
+    /**
+     * 词形与黑体条件。
+     *
+     * @param  array{words: list<string>, bold: string|null}  $criteria
+     */
+    private function matches(array $criteria): Builder
+    {
+        return WbwTemplate::query()
+            ->whereIn('real', $criteria['words'])
+            ->when($criteria['bold'] === 'only', fn (Builder $q) => $q->where('style', 'bld'))
+            ->when($criteria['bold'] === 'exclude', fn (Builder $q) => $q->where(
+                fn (Builder $q) => $q->where('style', '<>', 'bld')->orWhereNull('style'),
+            ));
+    }
+
+    /**
+     * 本页段落的正文与路径,一次查完。
+     *
+     * @param  Collection<int, mixed>  $rows
+     * @return Collection<string, PaliText>
+     */
+    private function paliTexts(Collection $rows): Collection
+    {
+        if ($rows->isEmpty()) {
+            return collect();
+        }
+
+        return PaliText::query()
+            ->where(function (Builder $q) use ($rows) {
+                foreach ($rows as $row) {
+                    $q->orWhere(fn (Builder $q) => $q->where('book', $row->book)->where('paragraph', $row->paragraph));
+                }
+            })
+            ->get(['book', 'paragraph', 'level', 'toc', 'path', 'html'])
+            ->keyBy(fn (PaliText $t) => "{$t->book}-{$t->paragraph}");
+    }
+
+    /**
+     * 本页段落在各印本里的页码,每种版本取段落里第一个页码标记。一次查完。
+     *
+     * @param  Collection<int, mixed>  $rows
+     * @return Collection<string, list<array{type: string, volume: int|null, page: int}>>
+     */
+    private function pageNumbers(Collection $rows): Collection
+    {
+        if ($rows->isEmpty()) {
+            return collect();
+        }
+
+        return PageNumber::query()
+            ->where(function (Builder $q) use ($rows) {
+                foreach ($rows as $row) {
+                    $q->orWhere(fn (Builder $q) => $q->where('book', $row->book)->where('paragraph', $row->paragraph));
+                }
+            })
+            ->orderBy('wid')
+            ->get(['type', 'volume', 'page', 'book', 'paragraph'])
+            ->groupBy(fn (PageNumber $p) => "{$p->book}-{$p->paragraph}")
+            ->map(fn (Collection $pages) => $pages->unique('type')->map(fn (PageNumber $p) => [
+                'type' => self::EDITIONS[$p->type] ?? (string) $p->type,
+                'volume' => $p->volume === null ? null : (int) $p->volume,
+                'page' => (int) $p->page,
+            ])->values()->all());
+    }
+
+    /**
+     * `pali_texts.path`(JSON 字符串,level 有时是字符串)→ 规整的数组。
+     *
+     * @return list<array{book: int, para: int, title: string, level: int}>
+     */
+    private static function path(mixed $raw): array
+    {
+        $items = is_string($raw) ? json_decode($raw, true) : $raw;
+        if (! is_array($items)) {
+            return [];
+        }
+
+        return array_values(array_map(fn (array $p) => [
+            'book' => (int) ($p['book'] ?? 0),
+            'para' => (int) ($p['paragraph'] ?? 0),
+            'title' => (string) ($p['title'] ?? ''),
+            'level' => (int) ($p['level'] ?? 0),
+        ], array_filter($items, 'is_array')));
+    }
+
+    /**
+     * 正文 HTML → 只含 `<b>`(黑体)与 `<mark>`(命中词形)的安全 HTML。
+     *
+     * 其余标签全部去掉、正文全部转义,客户端可以直接作为 HTML 渲染。命中词按整词匹配
+     * (前后不是字母),不区分首字母大小写;词形以 ti / nti 结尾的,正文里常写成
+     * 「词’’ti」,所以也匹配去掉 ti 后的部分(同 v2)。
+     *
+     * @param  list<string>  $words
+     * @return \Closure(string): string
+     */
+    private function highlighter(array $words): \Closure
+    {
+        $variants = [];
+        foreach ($words as $word) {
+            $variants[] = $word;
+            if (str_ends_with($word, 'nti')) {
+                $variants[] = mb_substr($word, 0, -3, 'UTF-8');
+            } elseif (str_ends_with($word, 'ti')) {
+                $variants[] = mb_substr($word, 0, -2, 'UTF-8');
+            }
+        }
+        $variants = array_filter(array_unique($variants), fn (string $v) => mb_strlen($v, 'UTF-8') > 1);
+        usort($variants, fn (string $a, string $b) => mb_strlen($b, 'UTF-8') <=> mb_strlen($a, 'UTF-8'));
+        $alternatives = implode('|', array_map(fn (string $v) => preg_quote(htmlspecialchars($v, ENT_QUOTES, 'UTF-8'), '/'), $variants));
+        $pattern = $alternatives === '' ? null : '/(?<![\p{L}\p{M}])('.$alternatives.')(?![\p{L}\p{M}])/iu';
+
+        return function (string $html) use ($pattern): string {
+            // 黑体先换成占位符,去标签、解实体、整体转义,再换回 <b>
+            $text = preg_replace('/<span class=["\']bld["\']>(.*?)<\/span>/su', "\u{E000}$1\u{E001}", $html) ?? '';
+            $text = htmlspecialchars(trim(html_entity_decode(strip_tags($text), ENT_QUOTES | ENT_HTML5, 'UTF-8')), ENT_QUOTES, 'UTF-8');
+            if ($pattern !== null) {
+                $text = preg_replace($pattern, '<mark>$1</mark>', $text) ?? $text;
+            }
+
+            return str_replace(["\u{E000}", "\u{E001}"], ['<b>', '</b>'], $text);
+        };
+    }
+}

+ 4 - 4
api-v13/config/mint.php

@@ -96,7 +96,7 @@ return [
         ],
         'api' => [
             'default' => env('APP_API', 'http://localhost:8000/api'),
-            'bamboo' => env('BAMBOO_API_HOST', env('APP_URL').'/api'),
+            'bamboo' => env('BAMBOO_API_HOST', env('APP_URL') . '/api'),
         ],
         'assets' => env('ASSETS_SERVER', 'localhost:9999'),
 
@@ -104,9 +104,9 @@ return [
         // dashboard-v6 的站点根。DASHBOARD_BASE_PATH 现在是 v4 的地址,v6 部署在它加 -v2026 的路径下,
         // 与 workspace_base_path 同一约定。v3 发出的邮件链接(找回密码等)都指向 v6,用这一项。
         // TODO v4下线后需要修改
-        'dashboard_v6_base_path' => env('DASHBOARD_BASE_PATH', 'http://127.0.0.1:4000/pcd').'-v2026',
+        'dashboard_v6_base_path' => env('DASHBOARD_BASE_PATH', 'http://127.0.0.1:4000/pcd') . '-v2026',
         // TODO v4下线后需要修改
-        'workspace_base_path' => env('DASHBOARD_BASE_PATH', 'http://127.0.0.1:4000/pcd').'-v2026/workspace',
+        'workspace_base_path' => env('DASHBOARD_BASE_PATH', 'http://127.0.0.1:4000/pcd') . '-v2026/workspace',
 
         'cdn_urls' => explode(',', env('CDN_URLS', 'https://www.wikipali.cc/downloads')),
 
@@ -202,7 +202,7 @@ return [
         ],
     ],
     'opensearch' => [
-        'index' => 'wikipali_global_20260813',
+        'index' => 'wikipali_global_20261119',
         // 索引 settings + mappings 定义文件所在目录,文件名为「{index}.json」
         'index_definition_path' => env('OPENSEARCH_INDEX_DEFINITION_PATH', base_path('../opensearch/indices')),
         'config' => [

+ 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 匹配不再扩展。
 
 ## 复现

+ 24 - 4
api-v13/resources/js/search-suggest.js

@@ -1,3 +1,15 @@
+// 搜索框的前缀补全,调 GET /api/v3/search-suggestions({data: [{text, resource_type, …}], meta})
+
+/** 候选文本来自索引内容,插进 HTML 前必须转义 */
+const escapeHtml = (value) =>
+    String(value ?? "").replace(/[&<>"']/g, (ch) => ({
+        "&": "&amp;",
+        "<": "&lt;",
+        ">": "&gt;",
+        '"': "&quot;",
+        "'": "&#39;",
+    })[ch]);
+
 document.addEventListener("DOMContentLoaded", () => {
     const inputs = document.querySelectorAll(".search-input");
 
@@ -29,11 +41,18 @@ document.addEventListener("DOMContentLoaded", () => {
 
                 const res = await fetch(url, {
                     signal: controller.signal,
+                    headers: { Accept: "application/json" },
                 });
 
+                // 补全只是辅助:失败(422 / 503 …)就不显示下拉,不打断输入
+                if (!res.ok) {
+                    dropdown.classList.remove("show");
+                    return;
+                }
+
                 const json = await res.json();
 
-                renderSuggestions(json.data.suggestions || []);
+                renderSuggestions(json.data || []);
             } catch (e) {
                 if (e.name !== "AbortError") {
                     console.error(e);
@@ -49,14 +68,15 @@ document.addEventListener("DOMContentLoaded", () => {
 
             dropdown.innerHTML = list
                 .map((item) => {
+                    const text = escapeHtml(item.text);
                     return `
                     <button type="button"
                         class="dropdown-item"
-                        data-text="${item.text}">
+                        data-text="${text}">
 
                         <div class="d-flex justify-content-between">
-                            <span>${item.text}</span>
-                            <small class="text-muted">${item.resource_type}</small>
+                            <span>${text}</span>
+                            <small class="text-muted">${escapeHtml(item.resource_type)}</small>
                         </div>
                     </button>
                 `;

+ 1 - 0
api-v13/resources/lang/en/site.php

@@ -20,6 +20,7 @@ return [
     // 停机维护开关(.stop 文件)触发时,API 的 RFC 9457 detail 文案
     'maintenance' => 'The service is under scheduled maintenance.',
     'not_found' => 'The requested resource does not exist.',
+    'search_unavailable' => 'The search service is temporarily unavailable. Please try again later.',
     'forbidden' => 'You are not allowed to perform this action.',
     'invalid_parameter' => 'Invalid parameter.',
     'author.name' => 'iapt',

+ 1 - 0
api-v13/resources/lang/zh-Hans/site.php

@@ -20,6 +20,7 @@ return [
     // 停机维护开关(.stop 文件)触发时,API 的 RFC 9457 detail 文案
     'maintenance' => '服务已进入停机维护状态',
     'not_found' => '请求的资源不存在',
+    'search_unavailable' => '搜索服务暂时不可用,请稍后再试',
     'forbidden' => '你没有执行该操作的权限',
     'invalid_parameter' => '参数不合法',
     'author.name' => 'iapt',

Некоторые файлы не были показаны из-за большого количества измененных файлов