Skip to content

Commit

Permalink
style: fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
oksana-miazina committed May 6, 2024
1 parent 97cd8e4 commit 877cf7b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/books")
@AllArgsConstructor
Expand All @@ -40,7 +39,8 @@ public ResponseEntity<SuccessResponse<BookDto>> getBookById(@PathVariable Long i
}

@PostMapping
public ResponseEntity<SuccessResponse<BookDto>> createBook(@Valid @RequestBody BookRequestDto bookDto) {
public ResponseEntity<SuccessResponse<BookDto>> createBook(
@Valid @RequestBody BookRequestDto bookDto) {
return ResponseHandler.getSuccessResponse(
bookService.save(bookDto),
HttpStatus.CREATED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@Getter
public class ErrorResponse extends GeneralResponse {
private List<Message> errors;
private final List<Message> errors;

public record Message(String field, String message) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

@Getter
public abstract class GeneralResponse {
private boolean success;
private int status;
private final boolean success;
private final int status;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy hh:mm:ss")
private Date timestamp;
private final Date timestamp;

public GeneralResponse(HttpStatus status) {
this.timestamp = new Date();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Getter
public class SuccessResponse<T> extends GeneralResponse {
private T data;
private final T data;

public SuccessResponse(T data, HttpStatus status) {
super(status);
Expand Down

0 comments on commit 877cf7b

Please sign in to comment.