Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created July 13, 2016 20:55
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/4ac9592dc627d495cc2c99f58b4717bb to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/4ac9592dc627d495cc2c99f58b4717bb to your computer and use it in GitHub Desktop.
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