Commit 3060b513 authored by 黎博's avatar 黎博

新增获取监控详情接口

parent f7e1d99c
......@@ -131,6 +131,20 @@ public class SqlMonitorTaskController {
return JsonResult.buildErrorStateResult("监控修改失败", false);
}
/**
* 获取监控详情
* @param id
* @return
*/
@GetMapping("/detail")
public JsonResult getSqlMonitorTaskDetail(@RequestParam Integer id) {
SqlMonitorTask sqlMonitorTask = sqlMonitorTaskService.getById(id);
if (sqlMonitorTask == null) {
return JsonResult.buildErrorStateResult("监控不存在!", false);
}
return JsonResult.buildSuccessResult(sqlMonitorTask);
}
/**
* 删除监控
*
......@@ -197,7 +211,7 @@ public class SqlMonitorTaskController {
if (resultList != null) {
dingText = SqlMonitorHandler.replaceDingText(dingText, resultList);
}
String markdownMsg = DingdingUtils.buildMarkdownMsg("监控测试", dingText + "\n" + JSON.toJSONString(resultList), false);
String markdownMsg = DingdingUtils.buildMarkdownMsg("监控测试", dingText, false);
boolean result = DingdingUtils.sendToDingding(markdownMsg, dingUrl);
return JsonResult.buildSuccessResult(result ? "发送成功!" : "发送失败!", true);
} catch (Exception e) {
......
......@@ -51,7 +51,7 @@ public class SqlMonitorHandler extends QuartzJobBean {
if (resultList != null) {
dingText = replaceDingText(dingText, resultList);
}
String markdownMsg = DingdingUtils.buildMarkdownMsg("监控测试", dingText + "\n" + JSON.toJSONString(resultList), false);
String markdownMsg = DingdingUtils.buildMarkdownMsg("监控测试", dingText, false);
DingdingUtils.sendToDingding(markdownMsg, dingUrl);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment