src/main/java/br/ufpa/labes/spm/web/rest/PlainResource.java
@PostMapping("/plains")
  public ResponseEntity<Plain> createPlain(@RequestBody Plain plain) throws URISyntaxException {
    log.debug("REST request to save Plain : {}", plain);
    if (plain.getId() != null) {
      throw new BadRequestAlertException(
          "A new plain cannot already have an ID", ENTITY_NAME, "idexists");
    }
    Plain result = plainRepository.save(plain);
    return ResponseEntity.created(new URI("/api/plains/" + result.getId()))
        .headers(
            HeaderUtil.createEntityCreationAlert(
                applicationName, true, ENTITY_NAME, result.getId().toString()))
        .body(result);
  }
/**
   * {@code POST /plains} : Create a new plain.
   *
   * @param plain the plain to create.
   * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new
   *     plain, or with status {@code 400 (Bad Request)} if the plain has already an ID.
   * @throws URISyntaxException if the Location URI syntax is incorrect.
   */
POST /plains : Create a new plain.
@param plain the plain to create.
@return the  ResponseEntity with status  201 (Created) and with body the new
plain, or with status  400 (Bad Request) if the plain has already an ID.
@throws URISyntaxException if the Location URI syntax is incorrect.
POST / plains : Create a new plain . @param plain the plain to create . @return the ResponseEntity with status 201 ( Created ) and with body the new plain or with status 400 ( Bad Request ) if the plain has already an ID . @throws URISyntaxException if the Location URI syntax is incorrect .
@PostMapping("/plains")
  public ResponseEntity<Plain> createPlain(@RequestBody Plain plain) throws URISyntaxException {
    log.debug("REST request to save Plain : {}", plain);
    if (plain.getId() != null) {
      throw new BadRequestAlertException(
          "A new plain cannot already have an ID", ENTITY_NAME, "idexists");
    }
    Plain result = plainRepository.save(plain);
    return ResponseEntity.created(new URI("/api/plains/" + result.getId()))
        .headers(
            HeaderUtil.createEntityCreationAlert(
                applicationName, true, ENTITY_NAME, result.getId().toString()))
        .body(result);
  }
@ PostMapping ( "/plains" ) public ResponseEntity < Plain > createPlain ( @ RequestBody Plain plain ) throws URISyntaxException { log . debug ( "REST request to save Plain : {}" , plain ) ; if ( plain . getId ( ) != null ) { throw new BadRequestAlertException ( "A new plain cannot already have an ID" , ENTITY_NAME , "idexists" ) ; } Plain result = plainRepository . save ( plain ) ; return ResponseEntity . created ( new URI ( "/api/plains/" + result . getId ( ) ) ) . headers ( HeaderUtil . createEntityCreationAlert ( applicationName , true , ENTITY_NAME , result . getId ( ) . toString ( ) ) ) . body ( result ) ; }
{@code POST /plains} : Create a new plain.
{ @code POST / plains } : Create a new plain .