Files
CFDivePlatform/openspec/specs/swagger-public-api/spec.md
T
a620906209 05ef8b9316 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-25 01:17:25 +08:00

31 lines
1.3 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.
## ADDED Requirements
### Requirement: 公開端點 Swagger 文件及共用 Schema
`app/Docs/PublicApiDoc.php` SHALL 文件化所有無需認證的公開端點,並定義全域共用 Schema。
#### Scenario: 共用 Schema 定義完整
- **WHEN** 執行 `php artisan l5-swagger:generate`
- **THEN** 以下 Schema 出現在產生的 JSON`DivingOffer``Review``CourseSchedule``PaginationMeta``ApiErrorResponse`
#### Scenario: GET /api/diving-offers 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** `GET /diving-offers` 端點顯示 query parameters`q``region``tag``per_page``page`)及包含分頁 meta 的 response schema
#### Scenario: GET /api/diving-offers/{id} 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** `GET /diving-offers/{id}` 端點顯示 path parameter `id` 及包含 `cover_image_url``images` 陣列的 response schema404 response 亦有定義
#### Scenario: GET /api/diving-offers/{id}/reviews 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** 端點顯示 `sort`helpful/rating/newest)、`page``per_page` 參數;response 包含 `summary`average、total、distribution)與分頁 `meta`
#### Scenario: GET /api/diving-offers/{id}/schedules 文件化
- **WHEN** 開啟 Swagger UI
- **THEN** 端點顯示 response 包含 `CourseSchedule` 陣列(id、date、period、capacity、booked_count、status