Compare commits

...

8 Commits

Author SHA1 Message Date
a620906209 5463fd70b1 Merge pull request 'chore:新增 swagger-api-docs-completion change 規劃' (#14) from feature/health-endpoint into master
Deploy Production / deploy (push) Successful in 25s
Reviewed-on: #14
2026-05-28 17:58:55 +00:00
a620906209 54dd4bb7a6 feat: 新增 /health 端點供 UptimeRobot 監控
檢查 DB 連線、Redis ping、Cache 讀寫,任一失敗回傳 503。
回應包含 timestamp、environment、PHP/Laravel 版本、記憶體用量。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 01:57:04 +08:00
a620906209 71b35533f4 Merge branch 'master' of https://github.com/a620906209/CFDivePlatform 2026-05-29 01:20:12 +08:00
a620906209 0814a3196f Merge pull request #2 from a620906209/feature/swagger-api-docs
Feature/swagger api docs
2026-05-25 02:35:37 +08:00
a620906209 0db38ee30d Merge pull request #1 from a620906209/docs/claude-md
docs:新增 CLAUDE.MD 技術與開發規範文件
2026-05-25 02:34:48 +08:00
a620906209 a3462f8493 security:移除 docker-compose.yml 硬編碼密碼,改用環境變數
Tests / PHP 8.2 (pull_request) Failing after 2s
Tests / PHP 8.3 (pull_request) Failing after 2s
pull requests / uneditable (pull_request_target) Failing after 0s
- DB_PASSWORD、MYSQL_ROOT_PASSWORD 改由 .env 注入
- MySQL healthcheck 移除密碼參數(改用無認證 ping)
- .env.example 補上 MYSQL_ROOT_PASSWORD 說明
- 已用 git filter-repo 清除歷史中的硬編碼密碼

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 01:30:54 +08:00
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
a620906209 95bafef52d chore:新增 swagger-api-docs-completion change 規劃
proposal / design / specs / tasks 全部就緒,21 tasks 待實作

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 00:45:15 +08:00
+33
View File
@@ -1,7 +1,40 @@
<?php <?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::get('/health', function () {
$checks = ['db' => false, 'redis' => false, 'cache' => false];
try {
DB::connection()->getPdo();
$checks['db'] = true;
} catch (\Throwable) {}
try {
Redis::ping();
$checks['redis'] = true;
} catch (\Throwable) {}
try {
cache()->put('health_check', 'ok', 5);
$checks['cache'] = cache()->get('health_check') === 'ok';
} catch (\Throwable) {}
$healthy = $checks['db'] && $checks['redis'] && $checks['cache'];
return response()->json([
'status' => $healthy ? 'ok' : 'degraded',
'timestamp' => now()->toIso8601String(),
'environment' => app()->environment(),
'php_version' => PHP_VERSION,
'laravel' => app()->version(),
'memory_mb' => round(memory_get_usage(true) / 1024 / 1024, 2),
'checks' => $checks,
], $healthy ? 200 : 503);
});
Route::get('/', function () { Route::get('/', function () {
return view('welcome'); return view('welcome');
}); });