@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);
    }
@ 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
@param orderId order id
@response 200
@response 404
@return Order or not found