diff --git a/src/main/java/cactusServer/resources/InstancesRest.java b/src/main/java/cactusServer/resources/InstancesRest.java index 0d803e9..fe3de0a 100644 --- a/src/main/java/cactusServer/resources/InstancesRest.java +++ b/src/main/java/cactusServer/resources/InstancesRest.java @@ -33,7 +33,7 @@ @Path("/instances") public class InstancesRest { - public static final String INSTANCES_URI = "CactusServer/instances"; + public static final String INSTANCES_URI = "/CactusServer/rest/instances"; public InstancesRest() { } @@ -75,22 +75,20 @@ return null; } - +// @Path("/{instanceId}/characters/{charactersId}") // @GET -// @Path("/characters") // @Produces(MediaType.APPLICATION_JSON) -// public Instance getCharacter(@QueryParam("AccountUniqueId") String AccountUniqueId) { -// return Instances.getInstance().getCharacter(AccountUniqueId); +// public Character getCharacter(@PathParam("instanceId") String instanceId, @PathParam("characterId") String characterId) { +// Instance instance = Instances.getInstance().getInstance(instanceId); +// if (instance != null) { +// return Instances.getCharacter(characterId); +// } +// return null; // } -// -// @POST -// @Path("/{createCharacter}") -// @Produces(MediaType.APPLICATION_JSON) -// public Instance createCharacter(@QueryParam("characterUniqueId") String characterUniqueId) { -// return Instances.getInstance().createCharacter(characterUniqueId); -// } -// + + + @POST @@ -121,6 +119,12 @@ return new URIAddressedEntity((INSTANCES_URI + "/" + instanceId + "/objects/" + ae.getId()), ae.getBody()); } +// @POST +// @Path("/{createCharacter}") +// @Produces(MediaType.APPLICATION_JSON) +// public Instance createCharacter(@QueryParam("characterUniqueId") String characterUniqueId) { +// return Instances.getInstance().createCharacter(characterUniqueId); +// } // @DELETE // @Path("/destroyInstance")