Created
July 13, 2016 20:55
-
-
Save pjazdzewski1990/4ac9592dc627d495cc2c99f58b4717bb to your computer and use it in GitHub Desktop.
This file contains 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 CalculatorService extends Service { | |
def calculate(fromValue: BigDecimal, | |
fromUnit: String, | |
toUnit: String | |
): ServiceCall[NotUsed, CalculatedValue] | |
def descriptor(): Descriptor = | |
named("calculatorservice") | |
.`with`( | |
restCall( | |
Method.GET, | |
"/api/calculator/exchange?fromValue&fromUnit&toUnit", | |
calculate _ | |
) | |
) | |
.`with`(classOf[BigDecimal], PathParamSerializers.BigDecimalSerializer) | |
.`with`(new MicroserviceExceptionSerializer) | |
.withAutoAcl(true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment