diff --git a/src/main/java/org/example/githubservice/controller/GithubController.java b/src/main/java/org/example/githubservice/controller/GithubController.java index eeeb21e..3df664b 100644 --- a/src/main/java/org/example/githubservice/controller/GithubController.java +++ b/src/main/java/org/example/githubservice/controller/GithubController.java @@ -17,10 +17,8 @@ public class GithubController { private final GithubService githubService; @GetMapping(value = REPOS_OF_USER, produces = MediaType.APPLICATION_JSON_VALUE) - public Flux listAllRepositoriesOfUser(@PathVariable String username, - @RequestParam(defaultValue = "0") int page, - @RequestParam(defaultValue = "30") int perPage) { - return githubService.listAllRepositoriesOfUser(username, page, perPage); + public Flux listAllRepositoriesOfUser(@PathVariable String username) { + return githubService.listAllRepositoriesOfUser(username); } @ExceptionHandler(ResponseStatusException.class) diff --git a/src/main/java/org/example/githubservice/service/api/GithubService.java b/src/main/java/org/example/githubservice/service/api/GithubService.java index c1706ed..693682e 100644 --- a/src/main/java/org/example/githubservice/service/api/GithubService.java +++ b/src/main/java/org/example/githubservice/service/api/GithubService.java @@ -5,6 +5,6 @@ import reactor.core.publisher.Mono; public interface GithubService { - Flux listAllRepositoriesOfUser(String username, int page, int perPage); + Flux listAllRepositoriesOfUser(String username); Mono listAllBranches(RepositoryDTO repositoryDTO); } diff --git a/src/main/java/org/example/githubservice/service/impl/GithubServiceImpl.java b/src/main/java/org/example/githubservice/service/impl/GithubServiceImpl.java index bf4f047..5b40e16 100644 --- a/src/main/java/org/example/githubservice/service/impl/GithubServiceImpl.java +++ b/src/main/java/org/example/githubservice/service/impl/GithubServiceImpl.java @@ -23,11 +23,9 @@ public GithubServiceImpl() { } @Override - public Flux listAllRepositoriesOfUser(String username, int page, int perPage) { + public Flux listAllRepositoriesOfUser(String username) { return webClient.get() .uri(uriBuilder -> uriBuilder.path(REPOS_OF_USER) - .queryParam("page", page) - .queryParam("per_page", perPage) .build(username)) .accept(MediaType.APPLICATION_JSON) .retrieve()