Ejemplo n.º 1
0
 /** PUT /servicess -> Updates an existing services. */
 @RequestMapping(
     value = "/servicess",
     method = RequestMethod.PUT,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Services> updateServices(@Valid @RequestBody Services services)
     throws URISyntaxException {
   log.debug("REST request to update Services : {}", services);
   if (services.getId() == null) {
     return createServices(services);
   }
   Services result = servicesService.save(services);
   return ResponseEntity.ok()
       .headers(HeaderUtil.createEntityUpdateAlert("services", services.getId().toString()))
       .body(result);
 }
Ejemplo n.º 2
0
 /** POST /servicess -> Create a new services. */
 @RequestMapping(
     value = "/servicess",
     method = RequestMethod.POST,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @Timed
 public ResponseEntity<Services> createServices(@Valid @RequestBody Services services)
     throws URISyntaxException {
   log.debug("REST request to save Services : {}", services);
   if (services.getId() != null) {
     return ResponseEntity.badRequest()
         .headers(
             HeaderUtil.createFailureAlert(
                 "services", "idexists", "A new services cannot already have an ID"))
         .body(null);
   }
   Services result = servicesService.save(services);
   return ResponseEntity.created(new URI("/api/servicess/" + result.getId()))
       .headers(HeaderUtil.createEntityCreationAlert("services", result.getId().toString()))
       .body(result);
 }