diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/card/dto/response/projection/CardInfoResponseDTO.java b/src/main/java/org/prgrms/nabimarketbe/domain/card/dto/response/projection/CardInfoResponseDTO.java index f4d79f8b..92f6c4b3 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/card/dto/response/projection/CardInfoResponseDTO.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/card/dto/response/projection/CardInfoResponseDTO.java @@ -8,7 +8,7 @@ public class CardInfoResponseDTO { private Long cardId; - private String thumbNail; + private String thumbnail; private String cardTitle; diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/card/service/CardService.java b/src/main/java/org/prgrms/nabimarketbe/domain/card/service/CardService.java index 60fe7499..95420a30 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/card/service/CardService.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/card/service/CardService.java @@ -325,6 +325,7 @@ public List getSuggestionResultCardList( if (pokeAvailable) { return parseCardListWithPokeAndOffer(cardList, priceRange); } + return parseCardListWithOnlyOffer(cardList, priceRange); } @@ -342,10 +343,19 @@ private List parseCardListWithPokeAndOffer( ) { return cardList.stream() .peek(cardSuggestionResponseDTO -> { - if (targetPriceRange.isHigherThan(cardSuggestionResponseDTO.getCardInfo().getPriceRange())) { - cardSuggestionResponseDTO.getSuggestionInfo().updateSuggestionType(SuggestionType.POKE); + if (targetPriceRange.isHigherThan( + cardSuggestionResponseDTO + .getCardInfo() + .getPriceRange() + ) + ) { + cardSuggestionResponseDTO + .getSuggestionInfo() + .updateSuggestionType(SuggestionType.POKE); } else { - cardSuggestionResponseDTO.getSuggestionInfo().updateSuggestionType(SuggestionType.OFFER); + cardSuggestionResponseDTO + .getSuggestionInfo() + .updateSuggestionType(SuggestionType.OFFER); } }).toList(); } @@ -355,14 +365,18 @@ private List parseCardListWithOnlyOffer( PriceRange priceRange ) { List offerOnlyCardList = cardList.stream() - .filter(cardSuggestionResponseDTO -> - cardSuggestionResponseDTO.getCardInfo() + .filter( + cardSuggestionResponseDTO -> cardSuggestionResponseDTO + .getCardInfo() .getPriceRange() - .isHigherThan(priceRange)) + .isHigherThan(priceRange) + ) .toList(); offerOnlyCardList.forEach(offerCard -> - offerCard.getSuggestionInfo().updateSuggestionType(SuggestionType.OFFER)); + offerCard + .getSuggestionInfo() + .updateSuggestionType(SuggestionType.OFFER)); return offerOnlyCardList; }