Spring REST - CRUD Database for Customer Relationship Management system.
-
- Create Customer REST Controller
- Include @Autowire Customer Service
- Add mapping for GET/customers
- Add mapping for GET/customers/{customerId}
-
- Create a custom error response class
- Create a custom exception class
- Update REST service to throw exception if customer is not found
- Add exception handler methods using @ExceptionHandler
- Add Customer
- Update Customer
- Delete Customer
@RequestMapping("/api")
- @GetMapping("/customers")
- @GetMapping("/customers/{customerId}")
- @PostMapping("/customers")
- @PutMapping("/customers")
- @DeleteMapping("/customers/{customerId}")