From 2a9499b5badfcee4dbd351e1dfaf3cb9200f507d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=85=B8=EA=B2=BD=EB=AF=BC?= Date: Wed, 13 Dec 2023 01:27:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20request=20body=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=EC=9E=90=20=EC=B6=94=EA=B0=80=20(#48)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/testcar/car/domains/auth/model/LoginRequest.java | 5 +++++ .../testcar/car/domains/car/model/RegisterCarRequest.java | 4 ++++ .../car/domains/carReservation/CarReservationService.java | 1 + .../domains/carReservation/model/CarReservationRequest.java | 4 ++++ .../carReservation/model/ReturnCarReservationRequest.java | 4 ++++ .../car/domains/carStock/model/DeleteCarStockRequest.java | 4 ++++ .../car/domains/carStock/model/RegisterCarStockRequest.java | 4 ++++ .../car/domains/carStock/model/UpdateCarStockRequest.java | 4 ++++ .../testcar/car/domains/carTest/model/CarTestRequest.java | 4 ++++ .../domains/department/model/CreateDepartmentRequest.java | 6 ++++++ .../car/domains/expense/model/RegisterExpenseRequest.java | 6 ++++++ .../domains/gasStation/model/DeleteGasStationRequest.java | 6 ++++++ .../domains/gasStation/model/RegisterGasStationRequest.java | 6 ++++++ .../domains/gasStation/model/UpdateGasStationRequest.java | 6 ++++++ .../model/RegisterGasStationHistoryRequest.java | 6 ++++++ .../car/domains/member/model/RegisterMemberRequest.java | 6 ++++++ .../car/domains/member/model/UpdateMemberRequest.java | 6 ++++++ .../testcar/car/domains/track/model/DeleteTrackRequest.java | 6 ++++++ .../car/domains/track/model/RegisterTrackRequest.java | 6 ++++++ .../trackReservation/model/TrackReservationRequest.java | 6 ++++++ 20 files changed, 100 insertions(+) diff --git a/src/main/java/com/testcar/car/domains/auth/model/LoginRequest.java b/src/main/java/com/testcar/car/domains/auth/model/LoginRequest.java index 754ab17..b886b74 100644 --- a/src/main/java/com/testcar/car/domains/auth/model/LoginRequest.java +++ b/src/main/java/com/testcar/car/domains/auth/model/LoginRequest.java @@ -5,11 +5,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter +@Builder @NoArgsConstructor +@AllArgsConstructor public class LoginRequest { @NotBlank(message = "이메일을 입력해주세요.") @Email(message = "이메일 형식을 확인해주세요.") @@ -17,6 +21,7 @@ public class LoginRequest { private String email; @Password + @NotBlank(message = "비밀번호를 입력해주세요.") @Schema(description = "비밀번호", example = "1234abcd@") private String password; } diff --git a/src/main/java/com/testcar/car/domains/car/model/RegisterCarRequest.java b/src/main/java/com/testcar/car/domains/car/model/RegisterCarRequest.java index 01f55dc..7808ef2 100644 --- a/src/main/java/com/testcar/car/domains/car/model/RegisterCarRequest.java +++ b/src/main/java/com/testcar/car/domains/car/model/RegisterCarRequest.java @@ -6,12 +6,16 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterCarRequest { @NotBlank(message = "차량명을 입력해주세요.") @Length(max = 20) diff --git a/src/main/java/com/testcar/car/domains/carReservation/CarReservationService.java b/src/main/java/com/testcar/car/domains/carReservation/CarReservationService.java index 6a9e0b9..8931f2d 100644 --- a/src/main/java/com/testcar/car/domains/carReservation/CarReservationService.java +++ b/src/main/java/com/testcar/car/domains/carReservation/CarReservationService.java @@ -64,6 +64,7 @@ public CarReservation reserve(Member member, CarReservationRequest request) { .startedAt(now) .expiredAt(expiredAt) .build(); + carStock.updateStatus(StockStatus.RESERVED); carStockRepository.save(carStock); return carReservationRepository.save(carReservation); } diff --git a/src/main/java/com/testcar/car/domains/carReservation/model/CarReservationRequest.java b/src/main/java/com/testcar/car/domains/carReservation/model/CarReservationRequest.java index 2dcbafd..ee017c7 100644 --- a/src/main/java/com/testcar/car/domains/carReservation/model/CarReservationRequest.java +++ b/src/main/java/com/testcar/car/domains/carReservation/model/CarReservationRequest.java @@ -4,11 +4,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class CarReservationRequest { @NotNull(message = "차량재고 ID를 입력해주세요.") @Positive(message = "차량재고 ID는 0보다 커야합니다.") diff --git a/src/main/java/com/testcar/car/domains/carReservation/model/ReturnCarReservationRequest.java b/src/main/java/com/testcar/car/domains/carReservation/model/ReturnCarReservationRequest.java index ec0f76c..c520486 100644 --- a/src/main/java/com/testcar/car/domains/carReservation/model/ReturnCarReservationRequest.java +++ b/src/main/java/com/testcar/car/domains/carReservation/model/ReturnCarReservationRequest.java @@ -5,11 +5,15 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import java.util.List; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class ReturnCarReservationRequest { @NotNull(message = "차량 예약 ID 리스트를 입력해주세요.") @NotEmpty(message = "차량 예약 ID 리스트를 입력해주세요.") diff --git a/src/main/java/com/testcar/car/domains/carStock/model/DeleteCarStockRequest.java b/src/main/java/com/testcar/car/domains/carStock/model/DeleteCarStockRequest.java index 8e3241e..a720c18 100644 --- a/src/main/java/com/testcar/car/domains/carStock/model/DeleteCarStockRequest.java +++ b/src/main/java/com/testcar/car/domains/carStock/model/DeleteCarStockRequest.java @@ -6,11 +6,15 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import java.util.List; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class DeleteCarStockRequest { @NotNull(message = "차량 재고 ID를 입력해주세요.") @NotEmpty(message = "차량 재고 ID를 입력해주세요.") diff --git a/src/main/java/com/testcar/car/domains/carStock/model/RegisterCarStockRequest.java b/src/main/java/com/testcar/car/domains/carStock/model/RegisterCarStockRequest.java index 05ab485..b2c2df5 100644 --- a/src/main/java/com/testcar/car/domains/carStock/model/RegisterCarStockRequest.java +++ b/src/main/java/com/testcar/car/domains/carStock/model/RegisterCarStockRequest.java @@ -7,11 +7,15 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterCarStockRequest { @NotNull(message = "차량 ID를 입력해주세요.") @Positive(message = "차량 ID는 0보다 커야합니다.") diff --git a/src/main/java/com/testcar/car/domains/carStock/model/UpdateCarStockRequest.java b/src/main/java/com/testcar/car/domains/carStock/model/UpdateCarStockRequest.java index afe238d..c5d507c 100644 --- a/src/main/java/com/testcar/car/domains/carStock/model/UpdateCarStockRequest.java +++ b/src/main/java/com/testcar/car/domains/carStock/model/UpdateCarStockRequest.java @@ -6,11 +6,15 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Pattern; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class UpdateCarStockRequest { @NotBlank(message = "차량 재고번호를 입력해주세요.") @Pattern(regexp = "^[0-9]{12}$", message = "차량 재고번호는 12자리 숫자만 가능합니다.") diff --git a/src/main/java/com/testcar/car/domains/carTest/model/CarTestRequest.java b/src/main/java/com/testcar/car/domains/carTest/model/CarTestRequest.java index a2e4c28..aee0083 100644 --- a/src/main/java/com/testcar/car/domains/carTest/model/CarTestRequest.java +++ b/src/main/java/com/testcar/car/domains/carTest/model/CarTestRequest.java @@ -6,11 +6,15 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import java.time.LocalDate; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter @Builder +@NoArgsConstructor +@AllArgsConstructor public class CarTestRequest { @NotBlank(message = "시험장 이름을 입력해주세요.") @Schema(description = "시험장 이름", example = "서산주행시험장") diff --git a/src/main/java/com/testcar/car/domains/department/model/CreateDepartmentRequest.java b/src/main/java/com/testcar/car/domains/department/model/CreateDepartmentRequest.java index b1f9195..5e2f062 100644 --- a/src/main/java/com/testcar/car/domains/department/model/CreateDepartmentRequest.java +++ b/src/main/java/com/testcar/car/domains/department/model/CreateDepartmentRequest.java @@ -3,9 +3,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class CreateDepartmentRequest { @NotBlank(message = "부서명을 입력해주세요.") @Schema(description = "부서명", example = "시스템관리팀") diff --git a/src/main/java/com/testcar/car/domains/expense/model/RegisterExpenseRequest.java b/src/main/java/com/testcar/car/domains/expense/model/RegisterExpenseRequest.java index a323726..8a65747 100644 --- a/src/main/java/com/testcar/car/domains/expense/model/RegisterExpenseRequest.java +++ b/src/main/java/com/testcar/car/domains/expense/model/RegisterExpenseRequest.java @@ -7,9 +7,15 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import java.time.LocalDate; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterExpenseRequest { @NotBlank(message = "지출내용을 입력해주세요.") @Schema(description = "지출내용", example = "차량수선비") diff --git a/src/main/java/com/testcar/car/domains/gasStation/model/DeleteGasStationRequest.java b/src/main/java/com/testcar/car/domains/gasStation/model/DeleteGasStationRequest.java index 1ae9841..64eb7d3 100644 --- a/src/main/java/com/testcar/car/domains/gasStation/model/DeleteGasStationRequest.java +++ b/src/main/java/com/testcar/car/domains/gasStation/model/DeleteGasStationRequest.java @@ -7,9 +7,15 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class DeleteGasStationRequest { @NotNull(message = "주유소 ID 리스트를 입력해주세요.") @NotEmpty(message = "주유소 ID 리스트를 입력해주세요.") diff --git a/src/main/java/com/testcar/car/domains/gasStation/model/RegisterGasStationRequest.java b/src/main/java/com/testcar/car/domains/gasStation/model/RegisterGasStationRequest.java index 689ad9f..8fcda6b 100644 --- a/src/main/java/com/testcar/car/domains/gasStation/model/RegisterGasStationRequest.java +++ b/src/main/java/com/testcar/car/domains/gasStation/model/RegisterGasStationRequest.java @@ -3,9 +3,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterGasStationRequest { @NotBlank(message = "주유소명을 입력해주세요.") @Schema(description = "주유소명", example = "서산주유소A") diff --git a/src/main/java/com/testcar/car/domains/gasStation/model/UpdateGasStationRequest.java b/src/main/java/com/testcar/car/domains/gasStation/model/UpdateGasStationRequest.java index 41668aa..713eabd 100644 --- a/src/main/java/com/testcar/car/domains/gasStation/model/UpdateGasStationRequest.java +++ b/src/main/java/com/testcar/car/domains/gasStation/model/UpdateGasStationRequest.java @@ -3,9 +3,15 @@ import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class UpdateGasStationRequest { @NotBlank(message = "주유소명을 입력해주세요.") @Schema(description = "주유소명", example = "서산주유소A") diff --git a/src/main/java/com/testcar/car/domains/gasStationHistory/model/RegisterGasStationHistoryRequest.java b/src/main/java/com/testcar/car/domains/gasStationHistory/model/RegisterGasStationHistoryRequest.java index 1f81877..e86ac25 100644 --- a/src/main/java/com/testcar/car/domains/gasStationHistory/model/RegisterGasStationHistoryRequest.java +++ b/src/main/java/com/testcar/car/domains/gasStationHistory/model/RegisterGasStationHistoryRequest.java @@ -8,9 +8,15 @@ import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Positive; import java.time.LocalDate; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterGasStationHistoryRequest { @NotBlank(message = "주유소 이름을 입력해주세요.") @Schema(description = "주유소 이름", example = "서산주유소A") diff --git a/src/main/java/com/testcar/car/domains/member/model/RegisterMemberRequest.java b/src/main/java/com/testcar/car/domains/member/model/RegisterMemberRequest.java index b935402..92a432a 100644 --- a/src/main/java/com/testcar/car/domains/member/model/RegisterMemberRequest.java +++ b/src/main/java/com/testcar/car/domains/member/model/RegisterMemberRequest.java @@ -8,10 +8,16 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterMemberRequest { @NotNull(message = "부서 ID를 입력해주세요.") @Positive(message = "부서 ID는 0보다 커야합니다.") diff --git a/src/main/java/com/testcar/car/domains/member/model/UpdateMemberRequest.java b/src/main/java/com/testcar/car/domains/member/model/UpdateMemberRequest.java index f351cb2..98d40e1 100644 --- a/src/main/java/com/testcar/car/domains/member/model/UpdateMemberRequest.java +++ b/src/main/java/com/testcar/car/domains/member/model/UpdateMemberRequest.java @@ -7,10 +7,16 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class UpdateMemberRequest { @NotNull(message = "부서 ID를 입력해주세요.") @Positive(message = "부서 ID는 0보다 커야합니다.") diff --git a/src/main/java/com/testcar/car/domains/track/model/DeleteTrackRequest.java b/src/main/java/com/testcar/car/domains/track/model/DeleteTrackRequest.java index 103b0ca..2ba5716 100644 --- a/src/main/java/com/testcar/car/domains/track/model/DeleteTrackRequest.java +++ b/src/main/java/com/testcar/car/domains/track/model/DeleteTrackRequest.java @@ -7,9 +7,15 @@ import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class DeleteTrackRequest { @NotNull(message = "시험장 ID 리스트를 입력해주세요.") @NotEmpty(message = "시험장 ID 리스트를 입력해주세요.") diff --git a/src/main/java/com/testcar/car/domains/track/model/RegisterTrackRequest.java b/src/main/java/com/testcar/car/domains/track/model/RegisterTrackRequest.java index b00031a..f939784 100644 --- a/src/main/java/com/testcar/car/domains/track/model/RegisterTrackRequest.java +++ b/src/main/java/com/testcar/car/domains/track/model/RegisterTrackRequest.java @@ -5,10 +5,16 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Positive; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.validator.constraints.Length; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class RegisterTrackRequest { @NotBlank(message = "시험장명을 입력해주세요.") @Length(max = 20, message = "시험장명은 20자 이하로 입력해주세요.") diff --git a/src/main/java/com/testcar/car/domains/trackReservation/model/TrackReservationRequest.java b/src/main/java/com/testcar/car/domains/trackReservation/model/TrackReservationRequest.java index 99c0ea2..b1ef3a4 100644 --- a/src/main/java/com/testcar/car/domains/trackReservation/model/TrackReservationRequest.java +++ b/src/main/java/com/testcar/car/domains/trackReservation/model/TrackReservationRequest.java @@ -9,9 +9,15 @@ import jakarta.validation.constraints.NotNull; import java.time.LocalDate; import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Getter; +import lombok.NoArgsConstructor; @Getter +@Builder +@NoArgsConstructor +@AllArgsConstructor public class TrackReservationRequest { @DateFormat @NotNull(message = "예약일자를 입력해주세요.")