优化数据同步ip白名单问题

master
chenxiwang 2024-08-28 17:48:48 +08:00
parent 1bc5a7615b
commit 1b3af7f0d1
2 changed files with 12 additions and 0 deletions

View File

@ -85,6 +85,9 @@ public class DataTask {
@Value("${jcskToken}")
private String jcskToken;// 荆楚水库同步接口token
@Value("${reloadCache}")
private String reloadCache;// 清除ip白名单缓存
public static String jcskPathPptnRoute = "/st_pptn_r";// 雨情接口
public static String jcskPathRiverRoute = "/st_rsvr_r";// 水位接口
@ -275,6 +278,13 @@ public class DataTask {
.build()).execute();
String respStr = resp.body().string();
JSONObject jsonObject = JSONObject.parseObject(respStr.toLowerCase());
String code = jsonObject.get("code").toString();
// 清除同步平台的ip白名单缓存
if (!"200".equals(code)) {
OkHttpClient clientCache = new OkHttpClient();
Request request = new Request.Builder().url(reloadCache).build();
clientCache.newCall(request).execute();
}
JSONArray data = jsonObject.getJSONArray("data");
if(ObjectUtils.isNotEmpty(data)){
List<StPptnR> rlist = data.toJavaList(StPptnR.class);

View File

@ -33,6 +33,8 @@ owrsvrPath: http://owrsvr.cloudowr.cn/
jcskPath: http://223.75.53.124:8002/shareddata/api/v1/monitdata/xfdbaj
jcskToken: 65E30623C28021BDC9400E2552FF88EB345FC5091BBE53C0650C489709C44075B13DD33924FEE38B7DFE9633B68E941126AB16D8BE875B480193141D9B8B8EB8
reloadCache: http://223.75.53.124:8002/shareddata/sys/whitelists/reloadCache
apiPath: http://223.75.53.141:8000/shzh/monitdata/datasync/getData
shqxjsWarnPath: http://223.75.53.141:8000/shzh/met/zyqxfw/api/warning/getGroupWarning