use of com.dubion.domain.Social in project dubion by valsamiq.
the class SocialResource method updateSocial.
/**
* PUT /socials : Updates an existing social.
*
* @param social the social to update
* @return the ResponseEntity with status 200 (OK) and with body the updated social,
* or with status 400 (Bad Request) if the social is not valid,
* or with status 500 (Internal Server Error) if the social couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/socials")
@Timed
public ResponseEntity<Social> updateSocial(@RequestBody Social social) throws URISyntaxException {
log.debug("REST request to update Social : {}", social);
if (social.getId() == null) {
return createSocial(social);
}
Social result = socialService.save(social);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, social.getId().toString())).body(result);
}
use of com.dubion.domain.Social in project dubion by valsamiq.
the class SocialResource method getSocial.
/**
* GET /socials/:id : get the "id" social.
*
* @param id the id of the social to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the social, or with status 404 (Not Found)
*/
@GetMapping("/socials/{id}")
@Timed
public ResponseEntity<Social> getSocial(@PathVariable Long id) {
log.debug("REST request to get Social : {}", id);
Social social = socialService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(social));
}
use of com.dubion.domain.Social in project dubion by valsamiq.
the class SocialResource method createSocial.
/**
* POST /socials : Create a new social.
*
* @param social the social to create
* @return the ResponseEntity with status 201 (Created) and with body the new social, or with status 400 (Bad Request) if the social has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/socials")
@Timed
public ResponseEntity<Social> createSocial(@RequestBody Social social) throws URISyntaxException {
log.debug("REST request to save Social : {}", social);
if (social.getId() != null) {
throw new BadRequestAlertException("A new social cannot already have an ID", ENTITY_NAME, "idexists");
}
Social result = socialService.save(social);
return ResponseEntity.created(new URI("/api/social/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Aggregations