Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created July 13, 2016 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjazdzewski1990/9bb8ee1c81fd719ec6fdd710321f6db1 to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/9bb8ee1c81fd719ec6fdd710321f6db1 to your computer and use it in GitHub Desktop.
trait ExchangeRatesService extends Service {
def getExchangeRate(fromUnit: String,
toUnit: String
): ServiceCall[NotUsed, ExchangeRatio]
def setExchangeRate(fromUnit: String,
toUnit: String
): ServiceCall[Rate, NotUsed]
def descriptor(): Descriptor =
named("exchangerates")
.`with`(
restCall(
Method.GET,
"/api/exchangerates/:fromUnit/:toUnit",
getExchangeRate _
),
restCall(
Method.PUT,
"/api/exchangerates/:fromUnit/:toUnit",
setExchangeRate _
)
)
.`with`(new MicroserviceExceptionSerializer)
.withAutoAcl(true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment