Search in sources :

Example 11 with SimpleResult

use of ru.sbtqa.tag.api.dto.SimpleResult 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();
}
Also used : SimpleResult(ru.sbtqa.tag.api.dto.SimpleResult) Path(jakarta.ws.rs.Path) POST(jakarta.ws.rs.POST) Produces(jakarta.ws.rs.Produces)

Aggregations

Path (jakarta.ws.rs.Path)11 Produces (jakarta.ws.rs.Produces)11 SimpleResult (ru.sbtqa.tag.api.dto.SimpleResult)11 POST (jakarta.ws.rs.POST)6 Consumes (jakarta.ws.rs.Consumes)4 GET (jakarta.ws.rs.GET)2 BasicDBList (com.mongodb.BasicDBList)1 BasicDBObject (com.mongodb.BasicDBObject)1 DELETE (jakarta.ws.rs.DELETE)1 PATCH (jakarta.ws.rs.PATCH)1 PUT (jakarta.ws.rs.PUT)1