@RestController
@CrossOrigin
public class CustomerController {
@Autowired
private CustomerService customerService;
@PostMapping("/customer")
public ResponseEntity<ResponseStructure<Customer>> saveCustomer(@RequestBody Customer customer)
{
return customerService.saveCustomer(customer);
}
@PutMapping("/customer")
public ResponseEntity<ResponseStructure<Customer>> updateCustomer(@RequestBody Customer customer)
{
return customerService.saveCustomer(customer);
}
@DeleteMapping("/customer/{id}")
public ResponseEntity<ResponseStructure<String>> deleteCustomer(@PathVariable int id)
{
return customerService.deleteCustomer(id);
}
// @GetMapping("/customer/{id}")
// public ResponseEntity<ResponseStructure<Customer>> getCustomer(@PathVariable int id)
// {
// return customerService.getCustomer(id);
// }
@GetMapping("/hospital/all")
public ResponseEntity<ResponseStructure<List<Customer>>> getAll()
{
return customerService.getAll();
}
}
Comments
Post a Comment
If you have any doubts, Please let me know