Search in sources :

Example 6 with SimpleResult

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

Example 7 with SimpleResult

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

Example 8 with SimpleResult

use of ru.sbtqa.tag.api.dto.SimpleResult 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 9 with SimpleResult

use of ru.sbtqa.tag.api.dto.SimpleResult 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)

Example 10 with SimpleResult

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

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