From d204b16e47c4bb7e59313e91a00bcc487c729a5c Mon Sep 17 00:00:00 2001 From: hskwon Date: Thu, 18 Dec 2025 20:29:30 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20API=20=EB=9D=BC?= =?UTF-8?q?=EC=9A=B0=ED=8A=B8=20=EC=88=9C=EC=84=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /me 라우트를 /{userId} 와일드카드보다 먼저 정의 - auth:sanctum 미들웨어 그룹으로 분리 - LOGICAL_RELATIONSHIPS.md 타임스탬프 업데이트 --- LOGICAL_RELATIONSHIPS.md | 2 +- routes/api.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/LOGICAL_RELATIONSHIPS.md b/LOGICAL_RELATIONSHIPS.md index 118e380..87d5e7a 100644 --- a/LOGICAL_RELATIONSHIPS.md +++ b/LOGICAL_RELATIONSHIPS.md @@ -1,6 +1,6 @@ # 논리적 데이터베이스 관계 문서 -> **자동 생성**: 2025-12-18 15:37:24 +> **자동 생성**: 2025-12-18 19:32:06 > **소스**: Eloquent 모델 관계 분석 ## 📊 모델별 관계 현황 diff --git a/routes/api.php b/routes/api.php index 698d281..eb83b32 100644 --- a/routes/api.php +++ b/routes/api.php @@ -569,10 +569,14 @@ // 회원 프로필(테넌트 기준) Route::prefix('profiles')->group(function () { Route::get('', [TenantUserProfileController::class, 'index'])->name('v1.profiles.index'); // 프로필 목록(테넌트 기준) + // /me 라우트는 /{userId} 와일드카드보다 먼저 정의해야 함 + // auth:sanctum 미들웨어로 Bearer 토큰 인증 필요 + Route::middleware('auth:sanctum')->group(function () { + Route::get('/me', [TenantUserProfileController::class, 'me'])->name('v1.profiles.me'); // 내 프로필 조회 + Route::patch('/me', [TenantUserProfileController::class, 'updateMe'])->name('v1.profiles.me.update'); // 내 프로필 수정 + }); Route::get('/{userId}', [TenantUserProfileController::class, 'show'])->name('v1.profiles.show'); // 특정 사용자 프로필 조회 Route::patch('/{userId}', [TenantUserProfileController::class, 'update'])->name('v1.profiles.update'); // 특정 사용자 프로필 수정(관리자) - Route::get('/me', [TenantUserProfileController::class, 'me'])->name('v1.profiles.me'); // 내 프로필 조회 - Route::patch('/me', [TenantUserProfileController::class, 'updateMe'])->name('v1.profiles.me.update'); // 내 프로필 수정 }); // Category API (통합)