diff --git a/src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java b/src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java index 8620b88..a403faa 100644 --- a/src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java +++ b/src/main/java/org/ntlab/acanthus_server/resources/gallery/StrokesRest.java @@ -18,6 +18,7 @@ private Position Position = new Position(); private ArrayList positions = new ArrayList<>(); private Stroke Test = new Stroke(); + private Gallery gallery = Gallery.getInstance(); /* * 1ページの1レイヤーに置ける筆跡情報を全て取得します。 @@ -30,7 +31,13 @@ @GET @Produces(MediaType.APPLICATION_JSON) public Stroke getStrokeRest(@PathParam("aid") Integer aid) { + var animation = gallery.getAnimationInformation(aid); return this.Test; +// if(animation != null) { +// return this.Test; +// }else{ +// throw new WebApplicationException(401); +// } } /* @@ -47,7 +54,13 @@ @Produces(MediaType.APPLICATION_JSON) public void addStrokes(@PathParam("aid") Integer aid, @FormParam("uid") Integer uid, @FormParam("uidToken") Integer uidToken, @FormParam("pen") Integer pen, @FormParam("color") Integer color, @FormParam("thick") Integer thick) { + var animation = gallery.getAnimationInformation(aid); this.Test.setStrokes(pen, color, thick); +// if(animation != null) { +// this.Test.setStrokes(pen, color, thick); +// }else{ +// throw new WebApplicationException(401); +// } } /* @@ -59,7 +72,13 @@ @GET @Produces(MediaType.APPLICATION_JSON) public ArrayList getPositions(@PathParam("aid") Integer aid, @PathParam("strokeNo") Integer strokeNo) { + var animation = gallery.getAnimationInformation(aid); return this.positions; +// if(animation != null) { +// return this.positions; +// }else{ +// throw new WebApplicationException(401); +// } } /* @@ -72,8 +91,15 @@ @POST @Produces(MediaType.APPLICATION_JSON) public void addPositions(@PathParam("aid") Integer aid, @FormParam("x") Float x, @FormParam("y") Float y) { + var animation = gallery.getAnimationInformation(aid); this.Position.setXY(x, y); this.positions.add(this.Position); +// if(animation != null) { +// this.Position.setXY(x, y); +// this.positions.add(this.Position); +// }else{ +// throw new WebApplicationException(401); +// } } }