diff --git a/src/main/java/org/ntlab/acanthus_server/models/Gallery.java b/src/main/java/org/ntlab/acanthus_server/models/Gallery.java index 077efb6..5222d91 100644 --- a/src/main/java/org/ntlab/acanthus_server/models/Gallery.java +++ b/src/main/java/org/ntlab/acanthus_server/models/Gallery.java @@ -29,9 +29,12 @@ public HashMap getMap(){return animationHashMap;} + public Animation getAnimationInformation( Integer aid){return animationHashMap.get(aid);} + public int registAnimation(String name, Account owner){ var newAnimation = new Animation(name, owner); var aid = new Random().nextInt(); + newAnimation.setAid(aid); animationHashMap.put(aid,newAnimation); return aid; } diff --git a/src/main/java/org/ntlab/acanthus_server/resources/gallery/GalleryRest.java b/src/main/java/org/ntlab/acanthus_server/resources/gallery/GalleryRest.java index 2bd2f86..af5ada5 100644 --- a/src/main/java/org/ntlab/acanthus_server/resources/gallery/GalleryRest.java +++ b/src/main/java/org/ntlab/acanthus_server/resources/gallery/GalleryRest.java @@ -32,5 +32,15 @@ } + @Path("/{aid}") + @GET + @Produces(MediaType.APPLICATION_JSON) + public Animation getAnimationInformation(@PathParam("aid") Integer aid){ + var searchAnimation =gallery.getAnimationInformation(aid); + + + return searchAnimation; + } + } \ No newline at end of file