@ RequestMapping ( path = "/{customerId}" , method = RequestMethod . GET ) public ResponseEntity < Customer > getCustomer ( @ PathVariable ( "customerId" ) Long customerId , @ RequestParam ( required = true ) String name ) { Customer customer = customerService . getCustomer ( customerId ) ; if ( customer != null ) { return new ResponseEntity < Customer > ( customer , HttpStatus . OK ) ; } return new ResponseEntity < Customer > ( HttpStatus . NOT_FOUND ) ; }
Get a specific customer by id