Skip to content

Commit

Permalink
Merge pull request #83 from SWEET-DEVELOPERS/feature/#79-room
Browse files Browse the repository at this point in the history
[fix] 선물방 이미지 default값 설정 코드 수정
  • Loading branch information
hysong4u authored Jan 17, 2024
2 parents b714035 + 519bf16 commit 25fecde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/sopt/sweet/domain/room/entity/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public class Room extends BaseTimeEntity {

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

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down Expand Up @@ -50,7 +49,7 @@ public class Room extends BaseTimeEntity {
@Builder
public Room(String gifteeName, String imageUrl, LocalDateTime deliveryDate, LocalDateTime tournamentStartDate, TournamentDuration tournamentDuration, String invitationCode, Member host) {
this.gifteeName = gifteeName;
this.imageUrl = DEFAULT_IMAGE_URL;
this.imageUrl = imageUrl;
this.gifterNumber = DEFAULT_NUMBER;
this.deliveryDate = deliveryDate;
this.tournamentStartDate = tournamentStartDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class RoomService {
private final GiftRepository giftRepository;
private final ProductRepository productRepository;
private static final String CHARACTERS = "abcdefghijklmnopqrstuvwxyz0123456789";
private static final String DEFAULT_IMAGE_URL = "https://sweet-gift-bucket.s3.ap-northeast-2.amazonaws.com/sweet.png";
private static final int CODE_LENGTH = 6;
private static final int MAX_GIFTER_NUMBER = 8;

Expand All @@ -52,7 +53,7 @@ public CreateRoomResponseDto createNewRoom(Long memberId, CreateRoomRequestDto c
String invitationCode = generateUniqueInvitationCode();
Room room = Room.builder()
.gifteeName(createRoomRequestDto.gifteeName())
.imageUrl(createRoomRequestDto.imageUrl())
.imageUrl(createRoomRequestDto.imageUrl() != null ? createRoomRequestDto.imageUrl() : DEFAULT_IMAGE_URL)
.deliveryDate(createRoomRequestDto.deliveryDate())
.tournamentStartDate(createRoomRequestDto.tournamentStartDate())
.tournamentDuration(createRoomRequestDto.tournamentDuration())
Expand Down Expand Up @@ -152,7 +153,7 @@ public RoomMemberDetailDto getRoomMembers(Long memberId, Long roomId) {
List<RoomMember> roomMembers = roomMemberRepository.findByRoomId(roomId);
List<RoomMemberDto> roomMemberDtoList = mapToRoomMemberDtoList(roomMembers);
RoomDto roomDto = new RoomDto(room.getGifteeName(), room.getGifterNumber());
OwnerDto ownerDto = new OwnerDto(room.getHost().getId(), room.getHost().getProfileImg(),room.getHost().getNickName());
OwnerDto ownerDto = new OwnerDto(room.getHost().getId(), room.getHost().getProfileImg(), room.getHost().getNickName());
return RoomMemberDetailDto.of(roomDto, ownerDto, roomMemberDtoList);
}

Expand Down

0 comments on commit 25fecde

Please sign in to comment.