diff --git a/src/main/java/org/ntlab/amaryllis/server/resources/VoicememosRest.java b/src/main/java/org/ntlab/amaryllis/server/resources/VoicememosRest.java index 4984349..71e1c04 100644 --- a/src/main/java/org/ntlab/amaryllis/server/resources/VoicememosRest.java +++ b/src/main/java/org/ntlab/amaryllis/server/resources/VoicememosRest.java @@ -28,23 +28,20 @@ @GET @Produces(MediaType.APPLICATION_JSON) - public Map getVoicememos(@QueryParam("latmax") Double latmax, @QueryParam("latmin") Double latmin, @QueryParam("longmax") Double longmax, @QueryParam("longmin") Double longmin) { + public ArrayList getVoicememos(@QueryParam("latmax") Double latmax, @QueryParam("latmin") Double latmin, @QueryParam("longmax") Double longmax, @QueryParam("longmin") Double longmin) { if (latmax == null || latmin == null || longmax == null || longmin == null) { throw new WebApplicationException(400); } - Map gettingVid = new HashMap(); - ArrayList vidlist = new ArrayList<>(); + ArrayList vidlist = new ArrayList<>(); for (Voicememo v : voicememos.getVoicememos()) { - String vid = v.getVid(); double latitude = v.getLatitude(); double longitude = v.getLongitude(); if (latmax > latitude && latitude > latmin && longmax > longitude && longitude > longmin ) { - vidlist.add(vid); + vidlist.add(v); } } - gettingVid.put("voicememos",vidlist); - return gettingVid; + return vidlist; } @POST