Skip to content

Commit

Permalink
Revert "Book validation added"
Browse files Browse the repository at this point in the history
  • Loading branch information
viacheslav-torbin authored Oct 21, 2023
1 parent ed78cc0 commit c107273
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 59 deletions.
4 changes: 0 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
<version.mapstruct-lombok>0.2.0</version.mapstruct-lombok>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/bookstore/controller/BookController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.bookstore.controller;

import jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.bookstore.dto.BookDto;
Expand Down Expand Up @@ -32,13 +31,13 @@ public BookDto getBookById(@PathVariable Long id) {
}

@PostMapping
public BookDto createBook(@RequestBody @Valid CreateBookRequestDto bookRequestDto) {
public BookDto createBook(@RequestBody CreateBookRequestDto bookRequestDto) {
return bookService.save(bookRequestDto);
}

@PutMapping("/{id}")
public void updateBookById(@PathVariable Long id,
@RequestBody @Valid CreateBookRequestDto bookRequestDto) {
@RequestBody CreateBookRequestDto bookRequestDto) {
bookService.updateBookById(id, bookRequestDto);
}

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/org/bookstore/dto/CreateBookRequestDto.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package org.bookstore.dto;

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

@Data
public class CreateBookRequestDto {
private Long id;
@NotBlank
private String title;
@NotBlank
private String author;
@NotBlank
private String isbn;
@PositiveOrZero
private BigDecimal price;
private String description;
private String coverImage;
Expand Down
46 changes: 0 additions & 46 deletions src/main/java/org/bookstore/exceptions/GlobalExceptionHandler.java

This file was deleted.

0 comments on commit c107273

Please sign in to comment.