Skip to content

Commit

Permalink
CHORE: Removing path parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Janek1010 committed Feb 15, 2024
1 parent 1ca4c4c commit dad2ce9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public class GithubController {
private final GithubService githubService;

@GetMapping(value = REPOS_OF_USER, produces = MediaType.APPLICATION_JSON_VALUE)
public Flux<RepositoryDTO> listAllRepositoriesOfUser(@PathVariable String username,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "30") int perPage) {
return githubService.listAllRepositoriesOfUser(username, page, perPage);
public Flux<RepositoryDTO> listAllRepositoriesOfUser(@PathVariable String username) {
return githubService.listAllRepositoriesOfUser(username);
}

@ExceptionHandler(ResponseStatusException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import reactor.core.publisher.Mono;

public interface GithubService {
Flux<RepositoryDTO> listAllRepositoriesOfUser(String username, int page, int perPage);
Flux<RepositoryDTO> listAllRepositoriesOfUser(String username);
Mono<RepositoryDTO> listAllBranches(RepositoryDTO repositoryDTO);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public GithubServiceImpl() {
}

@Override
public Flux<RepositoryDTO> listAllRepositoriesOfUser(String username, int page, int perPage) {
public Flux<RepositoryDTO> 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()
Expand Down

0 comments on commit dad2ce9

Please sign in to comment.