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;
|
}
|
|
|
|
|
|
}
|