data, and returns the output. Example
ResponseEntity singleController(Data data, HttpServletRequest hsr)
Now I have another endpoint which accepts multiple data. I just want to prevent writing all new logic, and wrap it with singleController.
ResponseEntity multiController(List<Data> dataList, HttpServletRequest hsr)
How can I do it? Would I need to pass the same instance of HttpServletRequest?
I also have ControllerAdvice configured which catches exceptions from singleController. How will that work with multiController?
I Roy, Why you are creating 2 different endpoints. You can keep the multiController endpoint only with List<Data> and you can pass single object in list for single request.
Let's just say the single end point already exists and I don't want to change the logic of that
Обсуждают сегодня