November 2018
Intermediate to advanced
388 pages
9h 5m
English
An endpoint, /organization, is exposed in the OrganizationController class using the @Path annotation as follows:
@Path("/organization")public class OrganizationController {}
In order to process the request in controller class, the POST function looks like this:
@POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) fun createOrganization(organizationRequest: OrganizationRequest) : Response { val response = "Created : ${organizationRequest.orgName}" var orgId = organizationService.createOrganization(organizationRequest) return Response.status(201) .location(URI(orgId)) .entity(response).build() }
This function accepts organizationRequest and processes it for validation ...
Read now
Unlock full access