Skip to content

Commit

Permalink
Merge pull request #181 from ShallWeProject/fix/179-updatereservation…
Browse files Browse the repository at this point in the history
…-req

[FIX] UpdateReservationReq Request 형식 수정
  • Loading branch information
leeseunghakhello authored Nov 29, 2023
2 parents f359548 + 483e128 commit 1daedeb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public ReservationResponse updateReservation(UpdateReservationReq updateReq,
UserPrincipal userPrincipal) {

Reservation updateReservation = reservationRepository.findById(
updateReq.getId()).map(
updateReq.getReservationId()).map(
reservation -> {
reservation.updateReservation(updateReq);
return reservationRepository.save(reservation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public class Reservation extends BaseEntity {
List<MemoryPhoto> memoryPhotos = new ArrayList<>();

public void updateReservation(UpdateReservationReq updateReq) {
this.persons = Optional.ofNullable(updateReq.getPersons()).orElse(this.persons);
// this.persons = Optional.ofNullable(updateReq.getPersons()).orElse(this.persons);
this.date = Optional.ofNullable(updateReq.getDate()).orElse(this.date);
this.time = Optional.ofNullable(updateReq.getTime()).orElse(this.time);
this.phoneNumber = Optional.ofNullable(updateReq.getPhone_number()).orElse(this.phoneNumber);
this.invitationImg = Optional.ofNullable(updateReq.getInvitation_img()).orElse(this.invitationImg);
this.invitationComment = Optional.ofNullable(updateReq.getInvitation_comment()).orElse(this.invitationComment);
// this.phoneNumber = Optional.ofNullable(updateReq.getPhone_number()).orElse(this.phoneNumber);
// this.invitationImg = Optional.ofNullable(updateReq.getInvitation_img()).orElse(this.invitationImg);
// this.invitationComment = Optional.ofNullable(updateReq.getInvitation_comment()).orElse(this.invitationComment);
}

public void updateUserReservationRequest(ReservationUserReq reservationRequest,User sender, User receiver){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@

import java.time.LocalDate;
import java.time.LocalTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;


@Data
public class UpdateReservationReq {

private Long id;
private Long persons;
@Schema(type = "long", example = "2", description = "예약 날짜")
private Long reservationId;
// private Long persons;

@Schema(type = "string", example = "2023-08-25", description = "예약 날짜")
private LocalDate date;

@Schema(type = "string", example = "13:00", description = "예약 시간")
private LocalTime time;
private String phone_number;
private String invitation_img;
private String invitation_comment;
// private String phone_number;
// private String invitation_img;
// private String invitation_comment;

}

0 comments on commit 1daedeb

Please sign in to comment.