Skip to content

Commit

Permalink
refactor: Path variable명 변경 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed Sep 27, 2023
1 parent 65cd832 commit 1893d5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public ResponseEntity<SliceResponseDto> searchMember(@AuthenticationPrincipal Us
, @ApiResponse(responseCode = "401", description = "인증에 실패했습니다.")
, @ApiResponse(responseCode = "404", description = "해당 회원을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@PostMapping("/{friendId}")
public ResponseEntity<Void> saveFriend(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long friendId) {
friendService.saveFriend(loginUser.getUsername(), friendId);
@PostMapping("/{memberId}")
public ResponseEntity<Void> saveFriend(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long memberId) {
friendService.saveFriend(loginUser.getUsername(), memberId);
return ResponseDto.noContent();
}

Expand All @@ -67,9 +67,9 @@ public ResponseEntity<Void> saveFriend(@AuthenticationPrincipal UserDetails logi
, @ApiResponse(responseCode = "401", description = "인증에 실패했습니다.")
, @ApiResponse(responseCode = "404", description = "1. 해당 회원을 찾을 수 없습니다. \t\n 2. 해당 회원과 친구가 아닙니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@DeleteMapping("/{friendId}")
public ResponseEntity<Void> deleteFriend(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long friendId) {
friendService.deleteFriend(loginUser.getUsername(), friendId);
@DeleteMapping("/{memberId}")
public ResponseEntity<Void> deleteFriend(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long memberId) {
friendService.deleteFriend(loginUser.getUsername(), memberId);
return ResponseDto.noContent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public class FriendRequestController {
, @ApiResponse(responseCode = "401", description = "인증에 실패했습니다.")
, @ApiResponse(responseCode = "404", description = "해당 회원을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@PostMapping("/{friendId}")
public ResponseEntity<Void> saveFriendRequest(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long friendId) {
friendRequestService.saveFriendRequest(loginUser.getUsername(), friendId);
@PostMapping("/{memberId}")
public ResponseEntity<Void> saveFriendRequest(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long memberId) {
friendRequestService.saveFriendRequest(loginUser.getUsername(), memberId);
return ResponseDto.noContent();
}

Expand All @@ -47,9 +47,9 @@ public ResponseEntity<Void> saveFriendRequest(@AuthenticationPrincipal UserDetai
, @ApiResponse(responseCode = "401", description = "인증에 실패했습니다.")
, @ApiResponse(responseCode = "404", description = "1. 해당 회원을 찾을 수 없습니다. \t\n 2. 해당 친구 요청을 찾을 수 없습니다.", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
})
@DeleteMapping("/{friendId}")
public ResponseEntity<Void> deleteFriendRequest(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long friendId) {
friendRequestService.deleteFriendRequest(loginUser.getUsername(), friendId);
@DeleteMapping("/{memberId}")
public ResponseEntity<Void> deleteFriendRequest(@AuthenticationPrincipal UserDetails loginUser, @PathVariable Long memberId) {
friendRequestService.deleteFriendRequest(loginUser.getUsername(), memberId);
return ResponseDto.noContent();
}

Expand Down

0 comments on commit 1893d5b

Please sign in to comment.