Skip to content

Commit

Permalink
Merge pull request #53 from team-nabi/NABI-261--yejin--fix--suggestio…
Browse files Browse the repository at this point in the history
…n-available-list

Nabi-261--fix : 썸네일에 null 이 들어가는 이슈 해결
  • Loading branch information
born-A authored Nov 20, 2023
2 parents 52a7c48 + 44f0454 commit 7f0f7af
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class CardInfoResponseDTO {
private Long cardId;

private String thumbNail;
private String thumbnail;

private String cardTitle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public List<CardSuggestionResponseDTO> getSuggestionResultCardList(
if (pokeAvailable) {
return parseCardListWithPokeAndOffer(cardList, priceRange);
}

return parseCardListWithOnlyOffer(cardList, priceRange);
}

Expand All @@ -342,10 +343,19 @@ private List<CardSuggestionResponseDTO> 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();
}
Expand All @@ -355,14 +365,18 @@ private List<CardSuggestionResponseDTO> parseCardListWithOnlyOffer(
PriceRange priceRange
) {
List<CardSuggestionResponseDTO> 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;
}
Expand Down

0 comments on commit 7f0f7af

Please sign in to comment.