Пример #1
0
 /** PUT /orderStatuss -> Updates an existing orderStatus. */
 @RequestMapping(
     value = "/orderStatuss",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> update(@Valid @RequestBody OrderStatus orderStatus)
     throws URISyntaxException {
   log.debug("REST request to update OrderStatus : {}", orderStatus);
   if (orderStatus.getId() == null) {
     return create(orderStatus);
   }
   orderStatusRepository.save(orderStatus);
   return ResponseEntity.ok().build();
 }
Пример #2
0
 /** POST /orderStatuss -> Create a new orderStatus. */
 @RequestMapping(
     value = "/orderStatuss",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Void> create(@Valid @RequestBody OrderStatus orderStatus)
     throws URISyntaxException {
   log.debug("REST request to save OrderStatus : {}", orderStatus);
   if (orderStatus.getId() != null) {
     return ResponseEntity.badRequest()
         .header("Failure", "A new orderStatus cannot already have an ID")
         .build();
   }
   orderStatusRepository.save(orderStatus);
   return ResponseEntity.created(new URI("/api/orderStatuss/" + orderStatus.getId())).build();
 }