Multiple @RequestMapping for a method in Controller class in Spring Boot
Yes it is possible @RestController public class UnitsController { @Autowired UnitDataRepository unitDataRepository; @RequestMapping({"/plugMillingDatas/unitData", "/bhaDatas/unitData"}) public ResponseEntity getModalBasedUOMData (@RequestParam (value = "modalClass", required = true) String modalClass) { UnitData unitData = unitDataRepository.findByModalClass(modalClass); return ResponseEntity.ok(unitData.getUnits().replace("\\\"", "\"").toString()); } } Hope this helps
No comments:
Post a Comment