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