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