Skip to content

Commit

Permalink
Merge branch '2.5.x' into 2.6.x
Browse files Browse the repository at this point in the history
Closes gh-30048
  • Loading branch information
wilkinsona committed Mar 3, 2022
2 parents 9722223 + ef92762 commit d11c5d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Expand Up @@ -38,19 +38,19 @@ public MyRestController(UserRepository userRepository, CustomerRepository custom
this.customerRepository = customerRepository;
}

@GetMapping("/{user}")
@GetMapping("/{userId}")
public Mono<User> getUser(@PathVariable Long userId) {
return this.userRepository.findById(userId);
}

@GetMapping("/{user}/customers")
@GetMapping("/{userId}/customers")
public Flux<Customer> getUserCustomers(@PathVariable Long userId) {
return this.userRepository.findById(userId).flatMapMany(this.customerRepository::findByUser);
}

@DeleteMapping("/{user}")
public void deleteUser(@PathVariable Long userId) {
this.userRepository.deleteById(userId);
@DeleteMapping("/{userId}")
public Mono<Void> deleteUser(@PathVariable Long userId) {
return this.userRepository.deleteById(userId);
}

}
Expand Up @@ -37,17 +37,17 @@ public MyRestController(UserRepository userRepository, CustomerRepository custom
this.customerRepository = customerRepository;
}

@GetMapping("/{user}")
@GetMapping("/{userId}")
public User getUser(@PathVariable Long userId) {
return this.userRepository.findById(userId).get();
}

@GetMapping("/{user}/customers")
@GetMapping("/{userId}/customers")
public List<Customer> getUserCustomers(@PathVariable Long userId) {
return this.userRepository.findById(userId).map(this.customerRepository::findByUser).get();
}

@DeleteMapping("/{user}")
@DeleteMapping("/{userId}")
public void deleteUser(@PathVariable Long userId) {
this.userRepository.deleteById(userId);
}
Expand Down

0 comments on commit d11c5d3

Please sign in to comment.