String url = "http://api.k780.com:88/?app=weather.history&weaid=%s&date=$s&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json"; for (Map<String, String> map : repairList) { String cityCode = map.get("code");//城市编码 String day = map.get("day"); url = String.format(url, cityCode, day); String weatherInfo = WeatherUtil.getWeatherInfo(url); JSONObject jsonObject = JSON.parseObject(weatherInfo); JSONArray jsonArray = jsonObject.getJSONArray("result"); JSONObject each = (JSONObject) jsonArray.get(0); String tem = each.getString("temp");//温度 String weather = each.getString("weather");//天气 String cityName = each.getString("citynm"); }
阿里巴巴JSON
最新推荐文章于 2021-02-27 12:34:38 发布