use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
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 = socialRepository.save(social);
return ResponseEntity.created(new URI("/api/socials/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class CompanyResource method createCompany.
/**
* POST /companies : Create a new company.
*
* @param company the company to create
* @return the ResponseEntity with status 201 (Created) and with body the new company, or with status 400 (Bad Request) if the company has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/companies")
@Timed
public ResponseEntity<Company> createCompany(@RequestBody Company company) throws URISyntaxException {
log.debug("REST request to save Company : {}", company);
if (company.getId() != null) {
throw new BadRequestAlertException("A new company cannot already have an ID", ENTITY_NAME, "idexists");
}
Company result = companyRepository.save(company);
return ResponseEntity.created(new URI("/api/companies/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class EpisodeResource method createEpisode.
/**
* POST /episodes : Create a new episode.
*
* @param episode the episode to create
* @return the ResponseEntity with status 201 (Created) and with body the new episode, or with status 400 (Bad Request) if the episode has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/episodes")
@Timed
public ResponseEntity<Episode> createEpisode(@RequestBody Episode episode) throws URISyntaxException {
log.debug("REST request to save Episode : {}", episode);
if (episode.getId() != null) {
throw new BadRequestAlertException("A new episode cannot already have an ID", ENTITY_NAME, "idexists");
}
Episode result = episodeRepository.save(episode);
return ResponseEntity.created(new URI("/api/episodes/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class ChapterSeenResource method createChapterSeen.
/**
* POST /chapter-seens : Create a new chapterSeen.
*
* @param chapterSeen the chapterSeen to create
* @return the ResponseEntity with status 201 (Created) and with body the new chapterSeen, or with status 400 (Bad Request) if the chapterSeen has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/chapter-seens")
@Timed
public ResponseEntity<ChapterSeen> createChapterSeen(@RequestBody ChapterSeen chapterSeen) throws URISyntaxException {
log.debug("REST request to save ChapterSeen : {}", chapterSeen);
if (chapterSeen.getId() != null) {
throw new BadRequestAlertException("A new chapterSeen cannot already have an ID", ENTITY_NAME, "idexists");
}
ChapterSeen result = chapterSeenRepository.save(chapterSeen);
return ResponseEntity.created(new URI("/api/chapter-seens/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class CountryResource method createCountry.
/**
* POST /countries : Create a new country.
*
* @param country the country to create
* @return the ResponseEntity with status 201 (Created) and with body the new country, or with status 400 (Bad Request) if the country has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/countries")
@Timed
public ResponseEntity<Country> createCountry(@RequestBody Country country) throws URISyntaxException {
log.debug("REST request to save Country : {}", country);
if (country.getId() != null) {
throw new BadRequestAlertException("A new country cannot already have an ID", ENTITY_NAME, "idexists");
}
Country result = countryRepository.save(country);
return ResponseEntity.created(new URI("/api/countries/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Aggregations