Skip to content

Commit

Permalink
Added dependency, CreateBookRequestDto converted to record
Browse files Browse the repository at this point in the history
  • Loading branch information
viacheslav-torbin committed Oct 21, 2023
1 parent 29e2ce8 commit 553a5b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/bookstore/dto/CreateBookRequestDto.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package org.bookstore.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import java.math.BigDecimal;
import lombok.Data;

@Data
public class CreateBookRequestDto {
private Long id;
public record CreateBookRequestDto(
Long id,
@NotBlank String title,
@NotBlank
private String title;
String author,
@NotBlank
private String author;
@NotBlank
private String isbn;
String isbn,
@NotNull
@PositiveOrZero
private BigDecimal price;
private String description;
private String coverImage;
}
BigDecimal price,
String description,
String coverImage
)
{}

0 comments on commit 553a5b1

Please sign in to comment.