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 52a8e4d..4198e2e 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 @@ -6,10 +6,7 @@ import javax.ws.rs.*; import javax.ws.rs.core.MediaType; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.SortedSet; +import java.util.*; // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // @@ -78,11 +75,20 @@ } // 画像URLを返す - @Path("/{aid}/pageMap/{pid}/image") + @Path("/{aid}/pageMap") @GET @Produces(MediaType.APPLICATION_JSON) - public String getLayers(@PathParam("aid") Integer aid, @PathParam("pid") Integer pid) { - return "http://nitta-lab-www.is.konan-u.ac.jp/gallery/" + aid + "/" + pid + "/a" + aid + "p" + pid + ".png"; + public HashMap getPageUrls(@PathParam("aid") Integer aid) { + Animation animation = gallery.getAnimationByAid(aid); + ArrayList pages = animation.getPages(); + HashMap pageUrl = new HashMap<>(); + + for (Page p: pages){ + String url = "http://nitta-lab-www.is.konan-u.ac.jp/gallery/" + aid + "/" + p.getPid() + "/a" + aid + "p" + p.getPid() + ".png"; + pageUrl.put(p.getPageNo(), url); + } + + return pageUrl; } // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/