保存进度!
This commit is contained in:
parent
95b3ad8f1b
commit
bc3b9b044f
|
@ -20,8 +20,8 @@
|
||||||
<module name="disaster_warning" target="1.8" />
|
<module name="disaster_warning" target="1.8" />
|
||||||
</bytecodeTargetLevel>
|
</bytecodeTargetLevel>
|
||||||
</component>
|
</component>
|
||||||
<component name="Encoding">
|
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
|
||||||
<file url="file://$PROJECT_DIR$/src/main/java/test/com/cpic/xim/notify/disaster/WeatherDisasterWarningGrabberTest.java" charset="GBK" />
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ExportToHTMLSettings">
|
<component name="ExportToHTMLSettings">
|
||||||
<option name="PRINT_LINE_NUMBERS" value="false" />
|
<option name="PRINT_LINE_NUMBERS" value="false" />
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
/**
|
||||||
|
* @author 王炜
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
package com.cpic.xim.notify.disaster;
|
package com.cpic.xim.notify.disaster;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
@ -12,6 +16,9 @@ import java.net.URL;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class WeatherDisasterWarningGrabber
|
public class WeatherDisasterWarningGrabber
|
||||||
{
|
{
|
||||||
private final static String QUERY_URL = "https://devapi.qweather.com/v7/warning/now?";
|
private final static String QUERY_URL = "https://devapi.qweather.com/v7/warning/now?";
|
||||||
|
@ -110,6 +117,12 @@ public class WeatherDisasterWarningGrabber
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将天气警告的json字符串转换成java对象。
|
||||||
|
* @param json json字符串
|
||||||
|
* @return 返回 QWeatherDisasterWarning 对象。
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
public static QWeatherDisasterWarning convertWeatherDisasterWarning( String json )
|
public static QWeatherDisasterWarning convertWeatherDisasterWarning( String json )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue