I have a controller:
@RestController
@RequestMapping(value = UserRestController.REST_URL, produces =
MediaType.APPLICATION_JSON_VALUE)
public class UserRestController {
static final String REST_URL = "/customers";
@GetMapping
public List<User> getAll() {
return service.getAll();
}
}
It succesfully handle such requests,as:
GET: /customers/
And I want to get users by some parameters.For example, email:
GET: /customers?email=someemail@gmail.
I tried:
@GetMapping("/")
public User getByEmail(@RequestParam(value = "email") String email) {
return super.getByEmail(email);
}
and expectedly I receive an exception, as "/" is already mapped on getAll-class. Is there any ways to solve this problem?