Skip to content

Commit

Permalink
Merge pull request #159 from ShallWeProject/feat/156-reservationModify
Browse files Browse the repository at this point in the history
예약 등록시 url, dto를 수정한다.
  • Loading branch information
hyunw9 authored Nov 22, 2023
2 parents 7fa6080 + 3663050 commit 063c84a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ public List<ReservationResponse> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ResponseCustom<List<ReservationResponse>> 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<List<ReservationResponse>> createReservation(
@Parameter(description = "예약 요청을 확인해주세요.", required = true) @RequestBody ReservationRequest reservationRequest,
@Parameter(description = "AccessToken 을 입력해주세요.", required = true) @CurrentUser UserPrincipal userPrincipal
Expand Down

0 comments on commit 063c84a

Please sign in to comment.