From 231d8c2bf7a757764a705ae29bdf195bbefbbd28 Mon Sep 17 00:00:00 2001 From: hyunw9 Date: Wed, 22 Nov 2023 18:04:10 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20user=20reservation=20post=20dto=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/reservation/dto/ReservationUserReq.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/shallwe/domain/reservation/dto/ReservationUserReq.java b/src/main/java/com/shallwe/domain/reservation/dto/ReservationUserReq.java index 96746dae..afc13782 100644 --- a/src/main/java/com/shallwe/domain/reservation/dto/ReservationUserReq.java +++ b/src/main/java/com/shallwe/domain/reservation/dto/ReservationUserReq.java @@ -15,26 +15,21 @@ public class ReservationUserReq { private Long experienceGiftId; private Long persons; - private Long senderId; private LocalDate date; private LocalTime time; private String phoneNumber; private String imageKey; private String invitationComment; - private ReservationStatus reservationStatus; @Builder - public ReservationUserReq(Long experienceGiftId, Long persons, Long senderId, LocalDate date, - LocalTime time, String phoneNumber, String imageKey, String invitationComment, - ReservationStatus reservationStatus) { + public ReservationUserReq(Long experienceGiftId, Long persons, LocalDate date, + LocalTime time, String phoneNumber, String imageKey, String invitationComment) { this.experienceGiftId = experienceGiftId; this.persons = persons; - this.senderId = senderId; this.date = date; this.time = time; this.phoneNumber = phoneNumber; this.imageKey = imageKey; this.invitationComment = invitationComment; - this.reservationStatus = reservationStatus; } } From 6088f37d0cb0c235725d394a57da71a8ca5d5c28 Mon Sep 17 00:00:00 2001 From: hyunw9 Date: Wed, 22 Nov 2023 18:19:35 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20=EC=82=AC=EC=9E=A5=20=EC=98=88?= =?UTF-8?q?=EC=95=BD=20=EB=93=B1=EB=A1=9D=20url=20=EA=B5=AC=EB=B6=84?= =?UTF-8?q?=EC=9E=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/reservation/presentation/ReservationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/shallwe/domain/reservation/presentation/ReservationController.java b/src/main/java/com/shallwe/domain/reservation/presentation/ReservationController.java index 6a1ba7e0..43def6fc 100644 --- a/src/main/java/com/shallwe/domain/reservation/presentation/ReservationController.java +++ b/src/main/java/com/shallwe/domain/reservation/presentation/ReservationController.java @@ -73,7 +73,7 @@ public ResponseCustom> getCurrentGiftReservation( @ApiResponse(responseCode = "201", description = "예약 생성 성공", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ReservationResponse.class))}), @ApiResponse(responseCode = "400", description = "예약 생성 실패", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class))} ) }) - @PostMapping + @PostMapping("/owner") public ResponseCustom> createReservation( @Parameter(description = "예약 요청을 확인해주세요.", required = true) @RequestBody ReservationRequest reservationRequest, @Parameter(description = "AccessToken 을 입력해주세요.", required = true) @CurrentUser UserPrincipal userPrincipal From 3663050a51566d35f637d804884c5976f9fb8f86 Mon Sep 17 00:00:00 2001 From: hyunw9 Date: Wed, 22 Nov 2023 18:33:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20updateReq=20sender,receiver=20id?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reservation/application/ReservationServiceImpl.java | 5 +++-- .../shallwe/domain/reservation/dto/UpdateReservationReq.java | 4 ---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/shallwe/domain/reservation/application/ReservationServiceImpl.java b/src/main/java/com/shallwe/domain/reservation/application/ReservationServiceImpl.java index eda49957..9935e26f 100644 --- a/src/main/java/com/shallwe/domain/reservation/application/ReservationServiceImpl.java +++ b/src/main/java/com/shallwe/domain/reservation/application/ReservationServiceImpl.java @@ -98,8 +98,9 @@ public List getCurrentGiftReservation(Long giftId) { @Transactional public ReservationResponse updateReservation(UpdateReservationReq updateReq, UserPrincipal userPrincipal) { - Reservation updateReservation = reservationRepository.findByReceiverIdAndId( - userPrincipal.getId(), updateReq.getId()).map( + + Reservation updateReservation = reservationRepository.findById( + updateReq.getId()).map( reservation -> { reservation.updateReservation(updateReq); return reservationRepository.save(reservation); diff --git a/src/main/java/com/shallwe/domain/reservation/dto/UpdateReservationReq.java b/src/main/java/com/shallwe/domain/reservation/dto/UpdateReservationReq.java index 8a45e4f1..b0c60b90 100644 --- a/src/main/java/com/shallwe/domain/reservation/dto/UpdateReservationReq.java +++ b/src/main/java/com/shallwe/domain/reservation/dto/UpdateReservationReq.java @@ -1,7 +1,5 @@ package com.shallwe.domain.reservation.dto; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.shallwe.domain.user.domain.User; import java.time.LocalDate; import java.time.LocalTime; import lombok.Data; @@ -14,8 +12,6 @@ public class UpdateReservationReq { private Long persons; private LocalDate date; private LocalTime time; - private User sender; - private User receiver; private String phone_number; private String invitation_img; private String invitation_comment;