Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.