/** PUT /categorys -> Updates an existing category. */
 @RequestMapping(
     value = "/categorys",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Category> updateCategory(@Valid @RequestBody Category category)
     throws URISyntaxException {
   log.debug("REST request to update Category : {}", category);
   if (category.getId() == null) {
     return createCategory(category);
   }
   Category result = categoryService.save(category);
   return ResponseEntity.ok()
       .headers(HeaderUtil.createEntityUpdateAlert("category", category.getId().toString()))
       .body(result);
 }