Skip to content

Commit

Permalink
Merge pull request #108 from SWEET-DEVELOPERS/feature/#107-member
Browse files Browse the repository at this point in the history
[fix] 선물 등록시 기본 이미지 추가
  • Loading branch information
hysong4u authored Jan 19, 2024
2 parents 8552f26 + f4739c4 commit 0ae68b7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class GiftService {
private static final int FIRST_PLACE_SCORE = 10;
private static final int SECOND_PLACE_SCORE = 5;

private static final String DEFAULT_GIFT_IMAGE_URL = "https://sweet-gift-bucket.s3.ap-northeast-2.amazonaws.com/gift.png";

public void createNewGift(Long memberId, CreateGiftRequestDto createGiftRequestDto) {
Member member = findMemberByIdOrThrow(memberId);
Room room = findRoomByIdOrThrow(createGiftRequestDto.roomId());
Expand Down Expand Up @@ -73,7 +75,7 @@ private Gift buildGift(Member member, Room room, CreateGiftRequestDto createGift
.url(createGiftRequestDto.url())
.name(createGiftRequestDto.name())
.cost(createGiftRequestDto.cost())
.imageUrl(createGiftRequestDto.imageUrl())
.imageUrl((createGiftRequestDto.imageUrl() != null && !createGiftRequestDto.imageUrl().trim().isEmpty()) ? createGiftRequestDto.imageUrl() : DEFAULT_GIFT_IMAGE_URL)
.room(room)
.member(member)
.build();
Expand Down

0 comments on commit 0ae68b7

Please sign in to comment.