Я пытался создать службу RestApi с загрузкой Spring
У меня есть родительский класс
public abstract class GenericRestController{
@RequestMapping(
produces = MediaType.APPLICATION_JSON_VALUE,
method = RequestMethod.GET,
path = "/list"
)
@ApiOperation("Get all entities")
public SimpleResponse create(@RequestParam(required = false) Integer page, @RequestParam(required = false) Integer size) {
..somehting
}
}
и
@RestController
@Api("Parameters")
@RequestMapping(value = Controller.PARAMETERS)
public class ParameterController extends
GenericRestController {
@RequestMapping(
produces = MediaType.APPLICATION_JSON_VALUE,
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE,
)
@ApiOperation("Create new entity")
public SimpleResponse create(@RequestBody Parameter parameter,
@PathVariable(value = "rate-id") Long rateId) { ...something
}
}
Я получаю ошибку
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'parameterController' method
public kz.sanscrit.cbs.common.pojo.SimpleResponse kz.sanscrit.cbs.rates.controllers.GenericRestController.create(E)
to {[/rates/{rate-id}/parameters],methods=[POST],consumes=[application/json],produces=[application/json]}: There is already 'parameterController' bean method
Как правильно перегрузить этот метод, потому что мне нужно расширить другие методы из этого GenericClass, но в случае создания у меня был другой дополнительный параметр