This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.rodrigofreitas.meuapp.resource; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
@Path("/hello") | |
public class HelloWordResource { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.rodrigofreitas.meuapp.resource; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
@Path("/hello") | |
public class HelloWordResource { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.rodrigofreitas.meuapp.service; | |
import javax.enterprise.context.ApplicationScoped; | |
@ApplicationScoped | |
public class HelloWordService { | |
public String getHelloWithName(String name) { | |
return "Seja bem-vindo ao quarkus, sr: " + name; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.rodrigofreitas.meuapp.resource; | |
import br.com.rodrigofreitas.meuapp.service.HelloWordService; | |
import javax.inject.Inject; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.PathParam; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn io.quarkus:quarkus-maven-plugin:0.19.1:create \ | |
-DprojectGroupId=br.com.rodrigofreitas \ | |
-DprojectArtifactId=meuapp \ | |
-DclassName="br.com.rodrigofreitas.meuapp.resource.HelloWordResource" \ | |
-Dpath="/hello" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//forma de adicionar enderecos a uma pessoa | |
Pessoa pessoaExemplo = new Pessoa(); | |
Endereco enderecoResidencial = new Endereco(); | |
Endereco enderecoComercia = new Endereco(); | |
pessoaExemplo.setNomeProprietario("Rodrigo Freitas"); | |
enderecoResidencial.setRua("Preto Caxias"); | |
enderecoComercia.setRua("Avenida Maringa"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//como criar atributo | |
private List<Endereco> enderecos = new ArrayList<>(); | |
// metodo criado para adicionar enderecos | |
public void addEndereco(Endereco endereco) { | |
enderecos.add(endereco); | |
} |