I have few methods in my spring controllers which are mapped on the same path, example.
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
protected ResourceDTO getById(@PathVariable int id) {
return super.getById(id);
}
I was wondering if there is a way to create an annotation that will automatically have set value and method, to have something like this:
@RequestMappingGetByID
protected ResourceDTO getById(@PathVariable int id) {
return super.getById(id);
}
Have a nice day everyone
Update The goal of this is the following all my controllers (eg. user, order, client) extends a parametrized BaseController that includes a base set of function (get by id, save, update, delete, etc) All the logic is on the BaseController, but in order to map the value I have to add the annotation on the specific controller. Instead of writing all the time {id} and post I would like to annotate the methods with a custom interface that already includes those values