Switched to jersey 2.3.5 due to jakarta being shit
parent
82d5d46fb3
commit
687cd0d4fb
@ -1,33 +1,31 @@
|
||||
package twopm.tech.bench.jaxrs;
|
||||
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
|
||||
|
||||
@Path("test")
|
||||
@Path("/test")
|
||||
public class TestResource {
|
||||
|
||||
@GET
|
||||
// @Path("/")
|
||||
@Produces("application/json")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String index() {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\" }";
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
@Path("/{id}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String get(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"GET\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("{id}")
|
||||
@Produces("application/json")
|
||||
@Path("/{id}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String post(@PathParam("id") Long id) {
|
||||
return "{ \"status\" : \"OK\", \"method\" : \"POST\", \"test\" : " + String.valueOf(id) + " }";
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue