Skip to content

Commit

Permalink
[fix] 내 선물 조회하기 API 엔드포인트 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Jan 15, 2024
1 parent 4fa8422 commit 1ff919c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ public ResponseEntity<SuccessResponse<?>> createNewGift(@UserId Long userId, @Re
return SuccessResponse.created(null);
}

@GetMapping("/my")
public ResponseEntity<SuccessResponse<?>> getMyGift(@UserId Long userId, @RequestBody MyGiftsRequestDto myGiftsRequestDto) {
final MyGiftsResponseDto myGiftsResponseDto = giftService.getMyGift(userId, myGiftsRequestDto);
@GetMapping("/my-gift/{roomId}")
public ResponseEntity<SuccessResponse<?>> getMyGift(@UserId Long userId, @PathVariable Long roomId) {
final MyGiftsResponseDto myGiftsResponseDto = giftService.getMyGift(userId, roomId);
return SuccessResponse.ok(myGiftsResponseDto);
}


@DeleteMapping("/my/{giftId}")
public ResponseEntity<SuccessResponse<?>> deleteMyGift(@UserId Long userId, @PathVariable Long giftId) {
giftService.deleteMyGift(userId, giftId);
Expand All @@ -52,13 +53,13 @@ public ResponseEntity<SuccessResponse<?>> evaluateTournamentScore(@UserId Long u
return SuccessResponse.created(null);
}

@GetMapping("tournament-info/{roomId}")
@GetMapping("/tournament-info/{roomId}")
public ResponseEntity<SuccessResponse<?>> getTournamentInfo(@UserId Long userId, @PathVariable Long roomId) {
final TournamentInfoDto tournamentInfo = giftService.getTournamentInfo(userId, roomId);
return SuccessResponse.ok(tournamentInfo);
}

@GetMapping("ranking/{roomId}")
@GetMapping("/ranking/{roomId}")
public ResponseEntity<SuccessResponse<?>> getRanking(@UserId Long userId, @PathVariable Long roomId) {
final List<TournamentRankingResponseDto> ranking = giftService.getTournamentRanking(roomId);
return SuccessResponse.ok(ranking);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public void createNewGift(Long memberId, CreateGiftRequestDto createGiftRequestD
}

@Transactional(readOnly = true)
public MyGiftsResponseDto getMyGift(Long memberId, MyGiftsRequestDto myGiftsRequestDto) {
public MyGiftsResponseDto getMyGift(Long memberId, Long roomId) {
Member member = findMemberByIdOrThrow(memberId);
Room room = findRoomByIdOrThrow(myGiftsRequestDto.roomId());
Room room = findRoomByIdOrThrow(roomId);
checkRoomMemberNotExists(room, member);
List<Gift> gifts = giftRepository.findByRoomAndMember(room, member);
List<MyGiftDto> myGiftsDtoList = mapGiftsToMyGiftDtoList(gifts);
Expand Down

0 comments on commit 1ff919c

Please sign in to comment.