mitao
2025-03-14 08f1b1f1804a8bd833d42f257908d80e88387b55
flower_city/src/main/java/com/dg/core/util/TestDate.java
@@ -87,6 +87,31 @@
    }
    /**
     * 获取节假日不含周末
     *
     * @return
     */
    public    Map getWeather(String code) {
        String url = "https://restapi.amap.com/v3/weather/weatherInfo?key=9e0d819935da8a01de0e476ba8a9019e&city="+code;
        OkHttpClient client = new OkHttpClient();
        Response response;
        //解密数据
        String rsa = null;
        Request request = new Request.Builder()
                .url(url)
                .get()
                .addHeader("Content-Type", "application/x-www-form-urlencoded")
                .build();
        try {
            response = client.newCall(request).execute();
            rsa = response.body().string();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(rsa, Map.class);
    }
    /**
     * 获取周末  月从0开始
     *
     * @param year