diff --git a/src/main/java/org/sopt/sweet/domain/gift/controller/GiftController.java b/src/main/java/org/sopt/sweet/domain/gift/controller/GiftController.java index 5baaf7a..5222c0c 100644 --- a/src/main/java/org/sopt/sweet/domain/gift/controller/GiftController.java +++ b/src/main/java/org/sopt/sweet/domain/gift/controller/GiftController.java @@ -73,11 +73,11 @@ public ResponseEntity> getRanking(@PathVariable Long roomId) @GetMapping("/friend/{roomId}") public ResponseEntity> getFriendGift(@UserId Long userId, @PathVariable Long roomId) { - TournamentStartDateResponseDto tournamentStartDate = giftService.getTournamentStartDate(roomId); + RoomInfoResponseDto roomInfoResponseDto = giftService.getRoomInfo(roomId); final List friendGiftList = giftService.getFriendGift(userId, roomId); Map result = new HashMap<>(); - result.put("tournamentStartDate", tournamentStartDate); + result.put("roomInfoResponseDto", roomInfoResponseDto); result.put("friendGiftDto", friendGiftList); return SuccessResponse.ok(result); diff --git a/src/main/java/org/sopt/sweet/domain/gift/dto/response/TournamentStartDateResponseDto.java b/src/main/java/org/sopt/sweet/domain/gift/dto/response/RoomInfoResponseDto.java similarity index 67% rename from src/main/java/org/sopt/sweet/domain/gift/dto/response/TournamentStartDateResponseDto.java rename to src/main/java/org/sopt/sweet/domain/gift/dto/response/RoomInfoResponseDto.java index 554c5c5..c7d4e00 100644 --- a/src/main/java/org/sopt/sweet/domain/gift/dto/response/TournamentStartDateResponseDto.java +++ b/src/main/java/org/sopt/sweet/domain/gift/dto/response/RoomInfoResponseDto.java @@ -2,7 +2,8 @@ import java.time.LocalDateTime; -public record TournamentStartDateResponseDto( +public record RoomInfoResponseDto( + String gifteeName, LocalDateTime tournamentStartDate ) { } diff --git a/src/main/java/org/sopt/sweet/domain/gift/service/GiftService.java b/src/main/java/org/sopt/sweet/domain/gift/service/GiftService.java index 3284a26..c4bb757 100644 --- a/src/main/java/org/sopt/sweet/domain/gift/service/GiftService.java +++ b/src/main/java/org/sopt/sweet/domain/gift/service/GiftService.java @@ -20,7 +20,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.time.Duration; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Comparator; @@ -280,9 +279,10 @@ private List mapGiftsToFriendGiftDtoList(List gifts) { .collect(Collectors.toList()); } - public TournamentStartDateResponseDto getTournamentStartDate(Long roomId) { + public RoomInfoResponseDto getRoomInfo(Long roomId) { Room room = findRoomByIdOrThrow(roomId); + String gifteeName = room.getGifteeName(); LocalDateTime tournamentStartDate = room.getTournamentStartDate(); - return new TournamentStartDateResponseDto(tournamentStartDate); + return new RoomInfoResponseDto(gifteeName,tournamentStartDate); } } \ No newline at end of file diff --git a/src/main/java/org/sopt/sweet/domain/member/service/OAuthService.java b/src/main/java/org/sopt/sweet/domain/member/service/OAuthService.java index 02484be..4afa3bd 100644 --- a/src/main/java/org/sopt/sweet/domain/member/service/OAuthService.java +++ b/src/main/java/org/sopt/sweet/domain/member/service/OAuthService.java @@ -180,7 +180,7 @@ public String sendDiscordNotification(String nickname) { RestTemplate restTemplate = new RestTemplate(); Long totalMembers = memberRepository.count(); - String message = nickname + "님이 회원가입했습니다! (누적 회원수: " + totalMembers + "명)\n"; + String message = totalMembers + "번째 유저가 회원가입했습니다!\n"; HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); diff --git a/src/main/java/org/sopt/sweet/domain/product/dto/response/HotProductsResponseDto.java b/src/main/java/org/sopt/sweet/domain/product/dto/response/HotProductsResponseDto.java index 62b331a..bd8e00b 100644 --- a/src/main/java/org/sopt/sweet/domain/product/dto/response/HotProductsResponseDto.java +++ b/src/main/java/org/sopt/sweet/domain/product/dto/response/HotProductsResponseDto.java @@ -7,12 +7,15 @@ @Builder public record HotProductsResponseDto( + String gifteeName, LocalDateTime tournamentStartDate, List hotProductDtoList ) { - public static HotProductsResponseDto of(LocalDateTime tournamentStartDate, + public static HotProductsResponseDto of( String gifteeName, + LocalDateTime tournamentStartDate, List hotProductDtoList) { return HotProductsResponseDto.builder() + .gifteeName(gifteeName) .tournamentStartDate(tournamentStartDate) .hotProductDtoList(hotProductDtoList) .build(); diff --git a/src/main/java/org/sopt/sweet/domain/product/service/ProductService.java b/src/main/java/org/sopt/sweet/domain/product/service/ProductService.java index df8c86e..b968800 100644 --- a/src/main/java/org/sopt/sweet/domain/product/service/ProductService.java +++ b/src/main/java/org/sopt/sweet/domain/product/service/ProductService.java @@ -33,7 +33,7 @@ public HotProductsResponseDto getHotGift(Long memberId, Long roomId) { Room room = findRoomByIdOrThrow(roomId); List allProducts = productRepository.findAll(); List hotProductDtoList = mapToHotProductDtoList(allProducts); - return HotProductsResponseDto.of(room.getTournamentStartDate(), hotProductDtoList); + return HotProductsResponseDto.of(room.getGifteeName(), room.getTournamentStartDate(), hotProductDtoList); } private Member findMemberByIdOrThrow(Long memberId) {