@ RequestMapping ( path = "/{orderId}" , method = { RequestMethod . GET , RequestMethod . POST } ) public ResponseEntity < Order > getOrder ( @ PathVariable ( "orderId" ) Long orderId ) { Order order = orderService . getOrder ( orderId ) ; if ( order != null ) { return new ResponseEntity ( order , HttpStatus . OK ) ; } return new ResponseEntity < Order > ( HttpStatus . NOT_FOUND ) ; }
Get order by id