Skip to content

Instantly share code, notes, and snippets.

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