|
@@ -14,6 +14,7 @@ import top.lvzhiqiang.exception.ParameterException;
|
|
|
import top.lvzhiqiang.mapper.CoinMapper;
|
|
import top.lvzhiqiang.mapper.CoinMapper;
|
|
|
import top.lvzhiqiang.service.CoinApiConfigService;
|
|
import top.lvzhiqiang.service.CoinApiConfigService;
|
|
|
import top.lvzhiqiang.service.CoinService;
|
|
import top.lvzhiqiang.service.CoinService;
|
|
|
|
|
+import top.lvzhiqiang.service.impl.CoinServiceImpl;
|
|
|
import top.lvzhiqiang.util.DateUtils;
|
|
import top.lvzhiqiang.util.DateUtils;
|
|
|
import top.lvzhiqiang.util.FtpUtil;
|
|
import top.lvzhiqiang.util.FtpUtil;
|
|
|
import top.lvzhiqiang.util.StringUtils;
|
|
import top.lvzhiqiang.util.StringUtils;
|
|
@@ -324,4 +325,21 @@ public class CoinController {
|
|
|
|
|
|
|
|
return R.ok().data("success");
|
|
return R.ok().data("success");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/serverMonitorAlarm")
|
|
|
|
|
+ public void serverMonitorAlarm(@RequestBody JSONObject params) {
|
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
|
+
|
|
|
|
|
+ params.forEach((k, v) -> {
|
|
|
|
|
+ sb.append(k).append(":").append(v).append("\n");
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (sb.length() <= 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ sb.insert(0, "服务器监控告警\n");
|
|
|
|
|
+
|
|
|
|
|
+ coinService.monitorAlarm(sb.delete(sb.length() - 1, sb.length()).toString(), CoinServiceImpl.JOB_ALARM_MODE_CHAT_BOT);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|