rk
2 天以前 5df732ffe16b3f162422c2db61a78458e28c7f8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.doumee.core.utils;
 
import lombok.extern.slf4j.Slf4j;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2025/10/10 11:31
 */
@Slf4j
public class WeatherUtil {
 
    //API地址: https://dev.qweather.com/docs/api/warning/weather-warning/
    private static final String apiPath = "/v7/warning/now";
 
    public  static  String getWeatherWarningInfo(String apiUrl,String apiKey,String location){
        String url = apiUrl + apiPath + "?key=" + apiKey + "&location=" + location;
        log.error(DateUtil.getCurrDateTime() + "天气请求地址:"+url);
        String response = HttpsUtil.get(url,false);
        log.error(DateUtil.getCurrDateTime() + "天气请求返回:"+response);
        return response;
    }
 
 
 
 
 
}