From dad2ce902726b06a39b691d0a6ff937561aa04a5 Mon Sep 17 00:00:00 2001 From: Janek1010 Date: Thu, 15 Feb 2024 15:45:43 +0100 Subject: [PATCH] CHORE: Removing path parameters --- .../example/githubservice/controller/GithubController.java | 6 ++---- .../example/githubservice/service/api/GithubService.java | 2 +- .../githubservice/service/impl/GithubServiceImpl.java | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) 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()