Skip to content

Instantly share code, notes, and snippets.

@caponetto
Last active Sep 11, 2020
Embed
What would you like to do?
Backend sample service: Rest endpoint
package org.kie.kogito.extended.services.quarkus.sample;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/sample")
public class SampleResource {
@Inject
SampleService sampleService;
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response hello(final HelloRequest request) {
final String message = sampleService.hello(request.getName(), request.getDelay());
return Response.ok(new HelloResponse(message)).build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment