diff --git a/src/main/java/com/example/cosmos_serversb/models/Shops.java b/src/main/java/com/example/cosmos_serversb/models/Shops.java index e360265..0a38008 100644 --- a/src/main/java/com/example/cosmos_serversb/models/Shops.java +++ b/src/main/java/com/example/cosmos_serversb/models/Shops.java @@ -40,9 +40,10 @@ String genre; String code; String location; + int count = 100; String[] split; try { - URL url = new URL("https://map.yahooapis.jp/search/local/V1/localSearch?bbox=" + leftLatitude + "," + leftLongitude + "," + rightLatitude + "," + rightLongitude + "&gc=02&results=90&output=json&appid=dj00aiZpPTVzYzloUDJjS0VMSyZzPWNvbnN1bWVyc2VjcmV0Jng9MGE-"); + URL url = new URL("https://map.yahooapis.jp/search/local/V1/localSearch?bbox=" + leftLatitude + "," + leftLongitude + "," + rightLatitude + "," + rightLongitude + "&gc=02&results=100&output=json&appid=dj00aiZpPTVzYzloUDJjS0VMSyZzPWNvbnN1bWVyc2VjcmV0Jng9MGE-"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.connect(); String tmp = ""; @@ -65,7 +66,11 @@ e.printStackTrace(); } - for (int i = 0; i < 10; i++) { + String total = jnode.get("ResultInfo").get("Total").asText(); + if(Integer.parseInt(total) < 100) { + count = Integer.parseInt(total); + } + for (int i = 0; i < count; i++) { genre = jnode.get("Feature").get(i).get("Property").get("Genre").get(0).get("Name").asText(); code = jnode.get("Feature").get(i).get("Property").get("Genre").get(0).get("Code").asText(); location = jnode.get("Feature").get(i).get("Geometry").get("Coordinates").asText();