use of com.furyviewer.domain.UserExt in project FuryViewer by TheDoctor-95.
the class UserExtResource method createUserExt.
/**
* POST /user-exts : Create a new userExt.
*
* @param userExt the userExt to create
* @return the ResponseEntity with status 201 (Created) and with body the new userExt, or with status 400 (Bad Request) if the userExt has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/user-exts")
@Timed
public ResponseEntity<UserExt> createUserExt(@RequestBody UserExt userExt) throws URISyntaxException {
log.debug("REST request to save UserExt : {}", userExt);
if (userExt.getId() != null) {
throw new BadRequestAlertException("A new userExt cannot already have an ID", ENTITY_NAME, "idexists");
}
UserExt result = userExtRepository.save(userExt);
return ResponseEntity.created(new URI("/api/user-exts/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.domain.UserExt in project FuryViewer by TheDoctor-95.
the class UserExtResource method updateUserExt.
/**
* PUT /user-exts : Updates an existing userExt.
*
* @param userExt the userExt to update
* @return the ResponseEntity with status 200 (OK) and with body the updated userExt,
* or with status 400 (Bad Request) if the userExt is not valid,
* or with status 500 (Internal Server Error) if the userExt couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/user-exts")
@Timed
public ResponseEntity<UserExt> updateUserExt(@RequestBody UserExt userExt) throws URISyntaxException {
log.debug("REST request to update UserExt : {}", userExt);
if (userExt.getId() == null) {
return createUserExt(userExt);
}
UserExt result = userExtRepository.save(userExt);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, userExt.getId().toString())).body(result);
}
Aggregations