| | package cactusServer.resources; |
---|
| | |
---|
| | import javax.ws.rs.DELETE; |
---|
| | import javax.ws.rs.FormParam; |
---|
| | import javax.ws.rs.GET; |
---|
| | import javax.ws.rs.POST; |
---|
| | import javax.ws.rs.PUT; |
---|
| | import javax.ws.rs.Path; |
---|
| | import javax.ws.rs.PathParam; |
---|
| | import javax.ws.rs.Produces; |
---|
| | import javax.ws.rs.QueryParam; |
---|
| | import javax.ws.rs.core.MediaType; |
---|
| | |
---|
| | import cactusServer.entities.Instance; |
---|
| | import cactusServer.models.Instances; |
---|
| |
---|
| | public Instance getInstance(@PathParam("instanceId") String instanceId) { |
---|
| | return Instances.getInstance().getInstance(instanceId); |
---|
| | } |
---|
| | |
---|
| | @POST |
---|
| | @Path("/createInstance") |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public Instance create(@QueryParam("instanceId") String instanceId, @QueryParam("name") String name) { |
---|
| | return Instances.getInstance().createInstance(instanceId, name); |
---|
| | } |
---|
| | |
---|
| | @DELETE |
---|
| | @Path("/destroyInstance") |
---|
| | @Produces(MediaType.APPLICATION_JSON) |
---|
| | public Instance destroy(@QueryParam("instanceId") String instanceId) { |
---|
| | 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) { |
---|
| | |
POSTメソッドとDELETEメソッドの追加
確認しました.
d4896c7
intomaster
fromInstanceRest
on 17 May 2018