-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adiciona camada de infraestrutura, com as classes nos pacotes correto…
…s, relacionados a entidade Bitcoin
- Loading branch information
Gustavo Dolmen Reche
committed
Oct 14, 2020
1 parent
84cdc2d
commit b641d06
Showing
5 changed files
with
76 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package br.com.dominio.bitcoin; | ||
|
||
import java.time.LocalDate; | ||
|
||
public class Bitcoin { | ||
|
||
private Long id; | ||
private Double preco; | ||
private String tipo; | ||
private LocalDate data; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Double getPreco() { | ||
return preco; | ||
} | ||
|
||
public void setPreco(Double preco) { | ||
this.preco = preco; | ||
} | ||
|
||
public String getTipo() { | ||
return tipo; | ||
} | ||
|
||
public void setTipo(String tipo) { | ||
this.tipo = tipo; | ||
} | ||
|
||
public LocalDate getData() { | ||
return data; | ||
} | ||
|
||
public void setData(LocalDate data) { | ||
this.data = data; | ||
} | ||
|
||
} |
This file contains 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
29 changes: 29 additions & 0 deletions
29
src/main/java/br/com/infraestrutura/bitcoin/BitcoinResource.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package br.com.infraestrutura.bitcoin; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RestClient; | ||
|
||
import br.com.dominio.bitcoin.Bitcoin; | ||
import br.com.dominio.bitcoin.service.BitcoinService; | ||
|
||
@Path("/bitcoinss") | ||
public class BitcoinResource { | ||
|
||
@Inject | ||
@RestClient | ||
BitcoinService bitcoinService; | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public List<Bitcoin> lista(){ | ||
return bitcoinService.lista(); | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
br.com.dominio.service.BitcoinService/mp-rest/url= | ||
br.com.dominio.bitcoin.service.BitcoinService/mp-rest/url=https://alura-bitcoin.herokuapp.com |