feat: 增加用户预约信息返回预约id

This commit is contained in:
BenjaminNH 2025-06-24 20:09:56 +08:00
parent 121ec9b684
commit eb7d8f92d1

View File

@ -15,6 +15,7 @@ import java.util.Map;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class UserReservationVO { public class UserReservationVO {
private String reservationId;
private String deviceName; private String deviceName;
private LocalDate startTime; private LocalDate startTime;
private LocalDate endTime; private LocalDate endTime;
@ -24,6 +25,7 @@ public class UserReservationVO {
private LocalDateTime createdTime; private LocalDateTime createdTime;
public UserReservationVO(Reservation r, Map<Long, String> deviceNameMap) { public UserReservationVO(Reservation r, Map<Long, String> deviceNameMap) {
this.reservationId = r.getId().toString();
this.deviceName = deviceNameMap.get(r.getDeviceId()); this.deviceName = deviceNameMap.get(r.getDeviceId());
this.startTime = r.getStartTime(); this.startTime = r.getStartTime();
this.endTime = r.getEndTime(); this.endTime = r.getEndTime();