Files
CFDivePlatform/openspec/changes/archive/2026-05-25-swagger-api-docs-completion/proposal.md
T
a620906209 0dda2bb2a3
Tests / PHP 8.2 (pull_request) Failing after 2s
Tests / PHP 8.3 (pull_request) Failing after 2s
docs:補全所有 API 端點 Swagger 文件(73 個端點)
- 修正 AuthApiDoc.php 路徑錯位(/register/member → /member/register 等)
  及 change-password 方法(Post→Put);補上 POST /logout、GET /user
- 新增 AuthSupplementDoc.php(Google OAuth 2 端點)
- 新增 PublicApiDoc.php(共用 Schema + 公開課程 4 端點)
- 新增 MemberApiDoc.php(預約、評價、通知共 13 端點)
- 新增 ProviderApiDoc.php(課程、圖片、時段、預約管理共 18 端點)
- 新增 AdminApiDoc.php(統計、會員/教練/課程管理共 16 端點)
- 更新 README.md
- 歸檔 swagger-api-docs-completion change,同步主規格

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 18:24:50 +00:00

38 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## Why
目前 Swagger 文件僅涵蓋 15 個 Auth 端點,其餘 61 個端點(課程、評價、預約、通知、圖片上傳、Coach Portal、Admin Panel)完全未文件化,導致前後端協作與第三方整合缺乏規格依據。現有 `darkaonline/l5-swagger` 套件已安裝,補全文件的邊際成本低。
## What Changes
- 為所有未文件化端點補上 `@OA` PHPDoc 標注(`app/Docs/` 目錄下依模組分檔)
- 定義完整的 Request / Response Schema(含分頁 meta、錯誤格式)
- 補全 Swagger Security 設定(Bearer token per-role
- 重新產生 `storage/api-docs/api-docs.json`
**端點範圍(新增 61 個):**
- Public APIGET diving-offers 列表/詳情、reviews、schedules4
- Member APIbookings CRUD、reviews CRUD、helpful 投票、notifications10
- Provider APIoffers CRUD + 圖片、schedules CRUD、bookings 管理(19
- Admin APIstats、members、providers、offers、bookings、reviews 管理(17
- Auth 補全:Google OAuth、change-password3 roles)(7
## Capabilities
### New Capabilities
- `swagger-public-api`:公開端點 Swagger 文件(diving-offers、reviews、schedules
- `swagger-member-api`Member 端點 Swagger 文件(bookings、reviews、notifications
- `swagger-provider-api`Provider 端點 Swagger 文件(offers、images、schedules、bookings
- `swagger-admin-api`Admin 端點 Swagger 文件(stats、user/offer/booking/review 管理)
- `swagger-auth-supplement`:補全 Auth 端點(Google OAuth、change-password
### Modified Capabilities
(無,本 change 純為文件補全,不變更任何 API 行為)
## Impact
- 新增:`app/Docs/PublicApiDoc.php``MemberApiDoc.php``ProviderApiDoc.php``AdminApiDoc.php``AuthSupplementDoc.php`
- 更新:`storage/api-docs/api-docs.json`(自動產生)
- 不影響任何 Controller、Model、Route、Migration