I still new in springboot java, can anyone assist if I want to achieve a result like if I have param pass in the controller which is A then it will go to AProductService return "A Product List", if the param is B then it will go to BProductService return "B Product List".
I have
- 1 controller which is 1 endpoint "product/list"
- 1 productservicefactory to control to access which services
- 2 services which is AProductService (implements ProductService), BProductService (implements ProductService)
- 1 interface which is ProductService
- 2 entity (AProduct, BProduct)
May I ask if I using List<?> in controller to return as response it is good practice?