Created
July 13, 2016 20:57
-
-
Save pjazdzewski1990/9bb8ee1c81fd719ec6fdd710321f6db1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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