Search in sources :

Example 6 with AchievementsAchievs

use of com.furyviewer.domain.AchievementsAchievs in project FuryViewer by TheDoctor-95.

the class AchievementsAchievsResource method createAchievementsAchievs.

/**
 * POST  /achievements-achievs : Create a new achievementsAchievs.
 *
 * @param achievementsAchievs the achievementsAchievs to create
 * @return the ResponseEntity with status 201 (Created) and with body the new achievementsAchievs, or with status 400 (Bad Request) if the achievementsAchievs has already an ID
 * @throws URISyntaxException if the Location URI syntax is incorrect
 */
@PostMapping("/achievements-achievs")
@Timed
public ResponseEntity<AchievementsAchievs> createAchievementsAchievs(@RequestBody AchievementsAchievs achievementsAchievs) throws URISyntaxException {
    log.debug("REST request to save AchievementsAchievs : {}", achievementsAchievs);
    if (achievementsAchievs.getId() != null) {
        throw new BadRequestAlertException("A new achievementsAchievs cannot already have an ID", ENTITY_NAME, "idexists");
    }
    AchievementsAchievs result = achievementsAchievsRepository.save(achievementsAchievs);
    return ResponseEntity.created(new URI("/api/achievements-achievs/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Also used : BadRequestAlertException(com.furyviewer.web.rest.errors.BadRequestAlertException) AchievementsAchievs(com.furyviewer.domain.AchievementsAchievs) URI(java.net.URI) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

AchievementsAchievs (com.furyviewer.domain.AchievementsAchievs)6 Timed (com.codahale.metrics.annotation.Timed)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Transactional (org.springframework.transaction.annotation.Transactional)3 BadRequestAlertException (com.furyviewer.web.rest.errors.BadRequestAlertException)1 URI (java.net.URI)1