Skip to content

Commit

Permalink
remove old fix, add a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
dArkjON committed May 8, 2018
1 parent 2cfd3ad commit aec29a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CMCTicker {
private String id;
private String name;
private String symbol;
private int rank;
private BigDecimal rank;
private BigDecimal price_usd;
private BigDecimal price_eur;
private BigDecimal price_btc;
Expand Down Expand Up @@ -52,11 +52,11 @@ public void setSymbol(String symbol) {
this.symbol = symbol;
}

public int getRank() {
public BigDecimal getRank() {
return rank;
}

public void setRank(int rank) {
public void setRank(BigDecimal rank) {
this.rank = rank;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ public BigDecimal getExchangeRateLast(String cryptoCurrency, String fiatCurrency
}

CMCTicker[] tickers;
if(Currencies.FLASH.equalsIgnoreCase(cryptoCurrency)){
tickers = api.getTickers(cryptoCurrency,fiatCurrency);
}else
tickers = api.getTickers(fiatCurrency, 0);


for (int i = 0; i < tickers.length; i++) {
CMCTicker ticker = tickers[i];
if (cryptoCurrency.equalsIgnoreCase(ticker.getName())) {
if (cryptoCurrency.equalsIgnoreCase(ticker.getSymbol())) {
if (Currencies.EUR.equalsIgnoreCase(fiatCurrency)) {
return ticker.getPrice_eur();
}else{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
public interface ICoinmarketcapAPI {
@GET
@Path("/")
CMCTicker[] getTickers(@QueryParam("convert") String fiatCurrency);
CMCTicker[] getTickers(@QueryParam("convert") String fiatCurrency, @QueryParam ("limit") int limit));

@GET
@Path("/{cryptoCurrency}/?convert={convert}")
CMCTicker[] getTickers(@PathParam("cryptoCurrency") String cryptoCurrency, @QueryParam("convert") String fiatCurrency);
@Path("/{cryptoToGet}/?convert={convert}")
CMCTicker[] getTickers(@PathParam("cryptoToGet") String cryptoToGet,@QueryParam("convert") String fiatCurrency);
}

0 comments on commit aec29a5

Please sign in to comment.