use of jakarta.ws.rs.Produces in project OpenGrok by OpenGrok.
the class SystemController method getIndexTime.
@GET
@Path("/indextime")
@Produces(MediaType.APPLICATION_JSON)
public String getIndexTime() throws JsonProcessingException {
Date date = new IndexTimestamp().getDateForLastIndexRun();
ObjectMapper mapper = new ObjectMapper();
// StdDateFormat is ISO8601 since jackson 2.9
mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
return mapper.writeValueAsString(date);
}
use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.
the class ClientJsonEndpoint method put.
@PUT
@Path("put")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response put(Client client) {
SimpleResult result = new SimpleResult();
result.setResult(client.getId() + client.getName() + client.getEmail());
return Response.ok(result).build();
}
use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.
the class ClientJsonEndpoint method requestFromFeature.
@POST
@Path("request-from-feature")
@Produces(MediaType.APPLICATION_JSON)
public Response requestFromFeature(@QueryParam(Default.QUERY_PARAMETER_NAME_1) String query1, @QueryParam(Default.QUERY_PARAMETER_NAME_2) String query2, @HeaderParam(Default.HEADER_PARAMETER_NAME_1) String header1, @HeaderParam(Default.HEADER_PARAMETER_NAME_2) String header2, Client client) {
SimpleResult result = new SimpleResult();
result.setResult(String.format("q1=%s|\nq2=%s|\nh1=%s|\nh2=%s|\nid=%s|\nname=%s|\nemail=%s|\n", query1, query2, header1, header2, client.getId(), client.getName(), client.getEmail()));
return Response.ok(result).header(Default.HEADER_PARAMETER_NAME_1, header1).header(Default.HEADER_PARAMETER_NAME_2, header2).build();
}
use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.
the class ClientJsonEndpoint method delete.
@DELETE
@Path("delete-client")
@Produces(MediaType.APPLICATION_JSON)
public Response delete(@QueryParam("client") String param) {
SimpleResult result = new SimpleResult();
result.setResult(param);
return Response.ok(result).build();
}
use of jakarta.ws.rs.Produces in project page-factory-2 by sbtqa.
the class ClientJsonEndpoint method postWithParams.
@POST
@Path("post")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response postWithParams(Client client) {
SimpleResult result = new SimpleResult();
result.setResult(client.getId() + client.getName() + client.getEmail());
return Response.ok(result).build();
}
Aggregations