|
@@ -668,6 +668,15 @@ public class CoinServiceImpl implements CoinService {
|
|
|
"<div>类型:" + "新闻快讯" + "</div>" +
|
|
"<div>类型:" + "新闻快讯" + "</div>" +
|
|
|
"<div>发布时间:" + createTime + "</div>" +
|
|
"<div>发布时间:" + createTime + "</div>" +
|
|
|
"<div class=\"gray\">描述:" + content.replace("\n", " ") + "</div>";
|
|
"<div class=\"gray\">描述:" + content.replace("\n", " ") + "</div>";
|
|
|
|
|
+
|
|
|
|
|
+ if (title.contains("Upbit") || title.contains("upbit")) {
|
|
|
|
|
+ JSONObject params4Upbit = new JSONObject();
|
|
|
|
|
+ params4Upbit.put("title", "BlockBeats监控报警");
|
|
|
|
|
+ params4Upbit.put("logUrl", link);
|
|
|
|
|
+ params4Upbit.put("btnTxt", "新闻详情");
|
|
|
|
|
+ SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(contentStr, params4Upbit, null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(contentStr, params, wxCpService4News);
|
|
SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(contentStr, params, wxCpService4News);
|
|
|
} else {
|
|
} else {
|
|
|
// 图文
|
|
// 图文
|
|
@@ -677,6 +686,14 @@ public class CoinServiceImpl implements CoinService {
|
|
|
article1.setDescription(content);
|
|
article1.setDescription(content);
|
|
|
article1.setTitle(title);
|
|
article1.setTitle(title);
|
|
|
|
|
|
|
|
|
|
+ if (title.contains("Upbit") || title.contains("upbit")) {
|
|
|
|
|
+ JSONObject params4Upbit = new JSONObject();
|
|
|
|
|
+ params4Upbit.put("title", "BlockBeats监控报警");
|
|
|
|
|
+ params4Upbit.put("logUrl", link);
|
|
|
|
|
+ params4Upbit.put("btnTxt", "新闻详情");
|
|
|
|
|
+ SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4NEWS(params4Upbit, null, article1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4NEWS(params, wxCpService4News, article1);
|
|
SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4NEWS(params, wxCpService4News, article1);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -742,6 +759,50 @@ public class CoinServiceImpl implements CoinService {
|
|
|
}
|
|
}
|
|
|
}, 0, 1, TimeUnit.HOURS);
|
|
}, 0, 1, TimeUnit.HOURS);
|
|
|
|
|
|
|
|
|
|
+ // Upbit交易所监控报警
|
|
|
|
|
+ scheduler.scheduleWithFixedDelay(() -> {
|
|
|
|
|
+ try {
|
|
|
|
|
+ Map<String, String> paramMap = new HashMap<>();
|
|
|
|
|
+ paramMap.put("page", "1");
|
|
|
|
|
+ paramMap.put("per_page", "20");
|
|
|
|
|
+ paramMap.put("thread_name", "general");
|
|
|
|
|
+ Connection.Response response = JsoupUtil.requestBody("https://api-manager.upbit.com/api/v1/notices", JsoupUtil.HTTP_GET, InitRunner.proxy, null, paramMap);
|
|
|
|
|
+ JSONObject result = JSONObject.parseObject(response.body());
|
|
|
|
|
+ JSONArray noticeList = result.getJSONObject("data").getJSONArray("list");
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < noticeList.size(); i++) {
|
|
|
|
|
+ if (i == 5) {
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject notice = noticeList.getJSONObject(i);
|
|
|
|
|
+ String idOri = notice.getString("id");
|
|
|
|
|
+ String id = "Upbit" + idOri;
|
|
|
|
|
+ String title = notice.getString("title");
|
|
|
|
|
+ if (title.contains("New digital asset on KRW Market") && !orderMap.containsKey(id)) {
|
|
|
|
|
+ orderMap.put(id, "1");
|
|
|
|
|
+
|
|
|
|
|
+ String createTime = notice.getString("created_at");
|
|
|
|
|
+ String updateTime = notice.getString("updated_at");
|
|
|
|
|
+ String viewCount = notice.getString("view_count");
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
|
|
+ params.put("title", "Upbit监控报警");
|
|
|
|
|
+ params.put("btnTxt", "通知详情");
|
|
|
|
|
+ params.put("logUrl", "https://sg-api-manager.upbit.com/api/v1/notices/" + idOri);
|
|
|
|
|
+ // 文本卡片
|
|
|
|
|
+ String contentStr = "<div class=\"highlight\">标题:" + title + "</div>" +
|
|
|
|
|
+ "<div>发布时间:" + createTime + "</div>" +
|
|
|
|
|
+ "<div>更新时间:" + updateTime + "</div>" +
|
|
|
|
|
+ "<div class=\"gray\">查看次数:" + viewCount + "</div>";
|
|
|
|
|
+
|
|
|
|
|
+ SpringUtils.getBean(CoinServiceImpl.class).monitorAlarm4APP_TEXT_CARD(contentStr, params, null);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 0, 3, TimeUnit.SECONDS);
|
|
|
|
|
+
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|