-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
86 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...nd/src/main/java/org/example/backend/reservation/domain/dto/ReservationDeleteRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.example.backend.reservation.domain.dto; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class ReservationDeleteRequest { | ||
private String password; | ||
} |
45 changes: 23 additions & 22 deletions
45
backend/src/main/java/org/example/backend/reservation/domain/dto/ReservationResDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
package org.example.backend.reservation.domain.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import java.time.LocalDateTime; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.example.backend.common.utils.TimeParsingUtils; | ||
import org.example.backend.reservation.domain.Reservation; | ||
import org.example.backend.reservation.domain.ReservationPurpose; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class ReservationResDto { | ||
private Long id; | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | ||
private String startTime; | ||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | ||
private String endTime; | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm") | ||
private LocalDateTime startTime; | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm") | ||
private LocalDateTime endTime; | ||
private ReservationPurpose purpose; | ||
private String etc; | ||
private Long roomId; | ||
private Long userId; | ||
private String userName; | ||
private String password; | ||
|
||
@Builder | ||
private ReservationResDto(Long id, String startTime, String endTime, | ||
ReservationPurpose purpose, String etc, | ||
Long roomId, Long userId) { | ||
public ReservationResDto(Long id, LocalDateTime startTime, LocalDateTime endTime, | ||
ReservationPurpose purpose, String etc, | ||
Long roomId, String userName, String password) { | ||
this.id = id; | ||
this.startTime = startTime; | ||
this.endTime = endTime; | ||
this.purpose = purpose; | ||
this.etc = etc; | ||
this.roomId = roomId; | ||
this.userId = userId; | ||
this.userName = userName; | ||
this.password = password; | ||
} | ||
|
||
public static ReservationResDto of(Reservation reservation) { | ||
return ReservationResDto.builder() | ||
.id(reservation.getId()) | ||
.startTime(TimeParsingUtils.formatterString(reservation.getStartTime())) | ||
.endTime(TimeParsingUtils.formatterString(reservation.getEndTime())) | ||
.purpose(reservation.getPurpose()) | ||
.etc(reservation.getEtc()) | ||
.roomId(reservation.getRoom().getId()) | ||
.userId(reservation.getUser().getId()) | ||
.build(); | ||
return new ReservationResDto( | ||
reservation.getId(), | ||
reservation.getStartTime(), | ||
reservation.getEndTime(), | ||
reservation.getPurpose(), | ||
reservation.getEtc(), | ||
reservation.getRoom().getId(), | ||
reservation.getUsername(), | ||
reservation.getPassword() | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters