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