保存进度!

This commit is contained in:
Kane Wang 2022-04-22 17:30:02 +08:00
parent 021b20876f
commit 116b4a0f12
2 changed files with 49 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2022-04-22 10:53:49
* @LastEditors: Kane
* @LastEditTime: 2022-04-22 16:22:12
* @LastEditTime: 2022-04-22 17:20:22
* @FilePath: \DisasterWarning\src\main\java\com\cpic\xim\wechat\officalAccount\sendMessage.java
* @Description: 用来推送公众号消息的程序库
*
@ -20,7 +20,10 @@ import java.io.*;
import java.net.URL;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.HashMap;
import java.util.Vector;
import com.cpic.xim.notify.disaster.*;
/**
* 推送微信公众号消息
@ -29,6 +32,8 @@ import java.util.Map;
*/
public class sendMessage
{
private static HashMap<String, String> warningLevel;
/**
* 向公众号推送通知消息接口文档参考 彭奕洁 编写消息发送接口调用文档
*
@ -141,11 +146,27 @@ public class sendMessage
}
/**
* @
* 推送天气灾害预警接口文档参考 彭奕洁 编写消息发送接口调用文档
* @param officalAccountURL 产险厦门分公司公众号接口网址
* @param warning 灾害警报
*/
public static void postNotifyMessage( String URL, Map<String, String> header, String param )
public static void sendWeatherDisasterWarning( String officalAccountURL,
QWeatherDisasterWarning warning )
{
Vector<QWeatherDisasterWarningItem> warningItems = warning.getWarning();
// 遍历消息
}
static
{
warningLevel = new HashMap<>();
warningLevel.put( "蓝色", "#0000FF" );
warningLevel.put( "黄色", "#FFFF00" );
warningLevel.put( "橙色", "#FFA500" );
warningLevel.put( "红色", "#FF0000" );
}
}

View File

@ -0,0 +1,24 @@
{
"code": "200",
"updateTime": "2022-04-22T15:54+08:00",
"fxLink": "http://hfx.link/3645",
"warning": [
{
"id": "10123060820220422061200476313081",
"sender": "东山县气象台",
"pubTime": "2022-04-22T06:12+08:00",
"title": "东山县气象台发布大雾黄色预警[Ⅲ级/较重]",
"status": "active",
"level": "黄色",
"type": "1017",
"typeName": "大雾",
"text": "东山县气象台2022年04月22日06时12分发布大雾黄色预警信号预计未来12小时内我县、闽南渔场和台湾浅滩渔场将出现能见度小于500米的雾。请注意防范",
"related": "",
"urgency": "",
"certainty": ""
}
],
"refer": { "sources": ["12379"], "license": ["no commercial use"] }
}
https://devapi.qweather.com/v7/warning/now?key=fe9fa8eeeb6f4301a92541eed565dd15&location=101230608