diff --git a/src/main/java/cactusServer/resources/InstancesRest.java b/src/main/java/cactusServer/resources/InstancesRest.java index 50a2139..c2c3037 100644 --- a/src/main/java/cactusServer/resources/InstancesRest.java +++ b/src/main/java/cactusServer/resources/InstancesRest.java @@ -1,5 +1,7 @@ package cactusServer.resources; +import java.util.Map; + import javax.ws.rs.DELETE; import javax.ws.rs.FormParam; import javax.ws.rs.GET; @@ -15,7 +17,7 @@ import cactusServer.models.Instances; -@Path("instances") +@Path("/instances") public class InstancesRest { public InstancesRest() { @@ -62,12 +64,15 @@ @POST - @Path("/createInstance") @Produces(MediaType.APPLICATION_JSON) - public Instance create(@QueryParam("instanceId") String instanceId, @QueryParam("name") String name) { - return Instances.getInstance().createInstance(instanceId, name); + public Map create(@QueryParam("name") String name, @QueryParam("state") Instance.State state) { + Instance instance = new Instance(name, state); + return Instances.getInstance().createInstance(instance); } + + + @DELETE @Path("/destroyInstance") @Produces(MediaType.APPLICATION_JSON) @@ -75,12 +80,12 @@ return Instances.getInstance().destroyInstance(instanceId); } - - // @Path("/{instanceId}") - // @PUT - // public Instance putInstance(@PathParam("InstanceId") String instanceId, @FormParam("areaId") int areaId, - // @FormParam("objectId") int objectId, @FormParam("characterId") String characterId) { - // - // } +// +// @Path("/{instanceId}") +// @PUT +// public Instance putInstance(@PathParam("InstanceId") String instanceId, @FormParam("areaId") int areaId, +// @FormParam("objectId") int objectId, @FormParam("characterId") String characterId) { +// +// } }