Skip to content

Commit

Permalink
fix: request body 기본 생성자 추가 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
gengminy authored Dec 12, 2023
1 parent c693b58 commit 2a9499b
Show file tree
Hide file tree
Showing 20 changed files with 100 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
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 = "이메일 형식을 확인해주세요.")
@Schema(description = "이메일", example = "[email protected]")
private String email;

@Password
@NotBlank(message = "비밀번호를 입력해주세요.")
@Schema(description = "비밀번호", example = "1234abcd@")
private String password;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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보다 커야합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 리스트를 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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를 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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보다 커야합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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자리 숫자만 가능합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "서산주행시험장")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "시스템관리팀")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "차량수선비")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 리스트를 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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보다 커야합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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보다 커야합니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 리스트를 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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자 이하로 입력해주세요.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "예약일자를 입력해주세요.")
Expand Down

0 comments on commit 2a9499b

Please sign in to comment.