Skip to content

Commit d0c19ce

Browse files
committed
refactor: ProfileController API 엔드포인트 및 HTTP 메서드 변경
- `ProfileController`의 기본 API 엔드포인트를 `/me/profile`에서 `/api/me/profile`로 변경 - 프로필 수정에 사용되던 **`PUT` 메서드를 제거하고,** 부분 업데이트에 더 적합한 `PATCH` 메서드를 도입
1 parent 68a48bb commit d0c19ce

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/main/java/com/back/domain/profile/controller/ProfileController.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import org.springframework.web.bind.annotation.*;
1212

1313
@RestController
14-
@RequestMapping("/me/profile")
14+
@RequestMapping("/api/me/profile")
1515
@RequiredArgsConstructor
1616
public class ProfileController {
1717

@@ -24,9 +24,14 @@ public RsData<ProfileResponseDto> getProfile(@AuthenticationPrincipal(expression
2424
return RsData.successOf(body); // code=200, message="success"
2525
}
2626

27-
@PutMapping
28-
public RsData<ProfileResponseDto> updateProfile(@AuthenticationPrincipal(expression = "id") Long userId, @Valid @RequestBody ProfileUpdateRequestDto profileUpdateRequestDto) {
29-
ProfileResponseDto body = profileService.updateProfile(userId, profileUpdateRequestDto);
30-
return RsData.successOf(body); // code=200
27+
// PUT 제거: PATCH 전용으로 운영
28+
29+
@PatchMapping
30+
public RsData<ProfileResponseDto> patchNickname(
31+
@AuthenticationPrincipal(expression = "id") Long userId,
32+
@Valid @RequestBody ProfileUpdateRequestDto request
33+
) {
34+
ProfileResponseDto body = profileService.updateProfile(userId, request);
35+
return RsData.successOf(body);
3136
}
3237
}

0 commit comments

Comments
 (0)