Search in sources :

Example 21 with Produces

use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.

the class ClientJsonEndpoint method arrayResponse.

@POST
@Path("arrays-as-is")
@Produces(MediaType.APPLICATION_JSON)
public Response arrayResponse(String request) {
    SimpleResult result = new SimpleResult();
    BasicDBList response = (BasicDBList) JSON.parse(request);
    result.setResult(response.toString());
    return Response.ok(result).build();
}
Also used : BasicDBList(com.mongodb.BasicDBList) SimpleResult(ru.sbtqa.tag.api.dto.SimpleResult) Path(jakarta.ws.rs.Path) POST(jakarta.ws.rs.POST) Produces(jakarta.ws.rs.Produces)

Example 22 with Produces

use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.

the class ClientJsonEndpoint method getWithParams.

@GET
@Path("get-with-params-placeholder")
@Produces(MediaType.APPLICATION_JSON)
public Response getWithParams(@HeaderParam(Default.HEADER_PARAMETER_NAME_1) String header1, @HeaderParam("header2") String header2, @QueryParam(Default.QUERY_PARAMETER_NAME_1) String query) {
    SimpleResult result = new SimpleResult();
    result.setResult(query + header1 + header2);
    return Response.ok(result).build();
}
Also used : SimpleResult(ru.sbtqa.tag.api.dto.SimpleResult) Path(jakarta.ws.rs.Path) Produces(jakarta.ws.rs.Produces) GET(jakarta.ws.rs.GET)

Aggregations

Produces (jakarta.ws.rs.Produces)22 Path (jakarta.ws.rs.Path)18 GET (jakarta.ws.rs.GET)12 SimpleResult (ru.sbtqa.tag.api.dto.SimpleResult)11 POST (jakarta.ws.rs.POST)7 CorsEnable (org.opengrok.web.api.v1.filter.CorsEnable)6 Consumes (jakarta.ws.rs.Consumes)4 File (java.io.File)4 PathAuthorized (org.opengrok.web.api.v1.filter.PathAuthorized)4 FileUtil.toFile (org.opengrok.web.util.FileUtil.toFile)4 WebApplicationException (jakarta.ws.rs.WebApplicationException)3 Project (org.opengrok.indexer.configuration.Project)3 BasicDBObject (com.mongodb.BasicDBObject)2 Instant (java.time.Instant)2 ArrayList (java.util.ArrayList)2 Document (org.apache.lucene.document.Document)2 RepositoryInfo (org.opengrok.indexer.history.RepositoryInfo)2 IndexDatabase.getDocument (org.opengrok.indexer.index.IndexDatabase.getDocument)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 StdDateFormat (com.fasterxml.jackson.databind.util.StdDateFormat)1