similar to this one
@Operation(
summary = "Create Book REST API",
description = "Create Book REST API is used to save book into database"
)
@ApiResponse(
responseCode = "201",
description = "Http Status 201 CREATED"
)
@PreAuthorize("hasRole('MANAGER')")
@PostMapping("/save")
@SecurityRequirement(name = "basicAuth")
public ResponseEntity save(@Valid @RequestBody CreateBookDto createBookDto){
return new ResponseEntity<>(bookService.save(createBookDto), HttpStatus.CREATED);
}
similar to this one @Operation( summary = "Create Book REST API", description = "Create Book REST API is used to save book into database" ) @ApiResponse( responseCode = "201", description = "Http Status 201 CREATED" ) @PreAuthorize("hasRole('MANAGER')") @PostMapping("/save") @SecurityRequirement(name = "basicAuth") public ResponseEntity save(@Valid @RequestBody CreateBookDto createBookDto){
return new ResponseEntity<>(bookService.save(createBookDto), HttpStatus.CREATED);
}