Skip to content

qyvlik/fiat-exchange-rates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fiat-exchange-rates

fiat exchange rates

docker

docker-compose

see fiat-rate-docker-compose

fiat-exchange-rates optional config

  1. startup.initRate, type is boolean, if true, app will fetch the rate data when app startup.
  2. spring.profiles.active: the value as follow: scheduling, test, prod, dev, the scheduling will fetch the rate every hour.

api

rates

curl localhost:8080/api/v1/pub/rate/rates

response as follow:

{
  "result":[
    {
      "base": "USD",
      "provider": "CurrencyLayer",
      "quote": "EUR",
      "rate": 0.871405,
      "ts": 1538994546000
    },
    ...
  ]
}

rate of base

curl localhost:8080/api/v1/pub/rate/usd

response as follow:

{
  "result":[
    {
      "base": "USD",
      "provider": "CurrencyLayer",
      "quote": "EUR",
      "rate": 0.871405,
      "ts": 1538994546000
    },
    ...
  ]
}

rate of base and quote

curl localhost:8080/api/v1/pub/rate/usd/cny

response as follow:

{
  "result":[
    {
      "base": "USD",
      "provider": "CurrencyLayer",
      "quote": "CNY",
      "rate": 6.920981,
      "ts": 1538994546000
    },
    ...
  ]
}