diff --git a/src/main/java/mate/academy/rickandmorty/controller/CharacterController.java b/src/main/java/mate/academy/rickandmorty/controller/CharacterController.java index 370417fc..2fb384f9 100644 --- a/src/main/java/mate/academy/rickandmorty/controller/CharacterController.java +++ b/src/main/java/mate/academy/rickandmorty/controller/CharacterController.java @@ -1,5 +1,7 @@ package mate.academy.rickandmorty.controller; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; import mate.academy.rickandmorty.dto.ResponseDto; @@ -13,14 +15,19 @@ @RestController @RequiredArgsConstructor @RequestMapping("/api/characters") +@Tag(name = "Rick and Morty management") public class CharacterController { private final CharacterService service; + @Operation(summary = "Get by name", + description = "Returns list of characters by name or name part") @GetMapping("/by-name") public List getCharactersByName(@RequestParam String name, Pageable pageable) { return service.getCharactersByName(name, pageable); } + @Operation(summary = "Get random character from DB", + description = "Returns random character from DB") @GetMapping("/random") public ResponseDto getRandomCharacter() { return service.getRandomCharacter(); diff --git a/src/main/java/mate/academy/rickandmorty/runner/CharacterLoaderRunner.java b/src/main/java/mate/academy/rickandmorty/runner/CharacterLoaderRunner.java index 10ac097f..f1105a21 100644 --- a/src/main/java/mate/academy/rickandmorty/runner/CharacterLoaderRunner.java +++ b/src/main/java/mate/academy/rickandmorty/runner/CharacterLoaderRunner.java @@ -18,7 +18,6 @@ public class CharacterLoaderRunner { public ApplicationRunner loadCharactersAtStartUp() { return args -> { try { - System.out.println("Loading characters from external API"); repository.saveAll(client.getAll()); } catch (Exception e) { throw new LoadExternalDataException(