Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
bd87532d
Commit
bd87532d
authored
Dec 30, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增执行策略接口
parent
0b6b9a2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
SqlMonitorTaskController.java
...g/holmes/controller/monitor/SqlMonitorTaskController.java
+19
-0
No files found.
src/main/java/cn/qg/holmes/controller/monitor/SqlMonitorTaskController.java
View file @
bd87532d
...
...
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -151,4 +152,22 @@ public class SqlMonitorTaskController {
return
JsonResult
.
buildErrorStateResult
(
"发送异常!"
,
false
);
}
}
@GetMapping
(
"/strategy"
)
public
JsonResult
getSqlMonitorStrategy
()
{
List
<
Map
<
String
,
String
>>
strategyList
=
new
ArrayList
<>();
Map
<
String
,
String
>
dailyMap
=
new
HashMap
<>();
Map
<
String
,
String
>
hourlyMap
=
new
HashMap
<>();
hourlyMap
.
put
(
"value"
,
"0 0 * * * ?"
);
hourlyMap
.
put
(
"label"
,
"每小时执行一次"
);
dailyMap
.
put
(
"value"
,
"0 0 10 * * ?"
);
dailyMap
.
put
(
"label"
,
"每天10点执行一次"
);
Map
<
String
,
String
>
weeklyMap
=
new
HashMap
<>();
weeklyMap
.
put
(
"value"
,
"0 0 10 ? * 2"
);
weeklyMap
.
put
(
"label"
,
"每周一上午10点执行一次"
);
strategyList
.
add
(
hourlyMap
);
strategyList
.
add
(
dailyMap
);
strategyList
.
add
(
weeklyMap
);
return
JsonResult
.
buildSuccessResult
(
strategyList
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment