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
d9642a1b
Commit
d9642a1b
authored
Dec 28, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取监控列表接口
parent
93e84720
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
MonitorTaskController.java
...n/qg/holmes/controller/monitor/MonitorTaskController.java
+9
-5
MonitorTask.java
src/main/java/cn/qg/holmes/entity/monitor/MonitorTask.java
+3
-0
No files found.
src/main/java/cn/qg/holmes/controller/monitor/MonitorTaskController.java
View file @
d9642a1b
...
@@ -43,7 +43,7 @@ public class MonitorTaskController {
...
@@ -43,7 +43,7 @@ public class MonitorTaskController {
* @param pageSize 每页多少个
* @param pageSize 每页多少个
* @param businessLine 业务线
* @param businessLine 业务线
* @param serviceName 服务名
* @param serviceName 服务名
* @param
owner 负责人
* @param
taskName 监控名称
* @return
* @return
*/
*/
@GetMapping
(
"/list"
)
@GetMapping
(
"/list"
)
...
@@ -51,7 +51,7 @@ public class MonitorTaskController {
...
@@ -51,7 +51,7 @@ public class MonitorTaskController {
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
pageSize
,
@RequestParam
String
businessLine
,
@RequestParam
String
businessLine
,
@RequestParam
String
serviceName
,
@RequestParam
String
serviceName
,
@RequestParam
String
owner
)
{
@RequestParam
String
taskName
)
{
QueryWrapper
<
MonitorTask
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
MonitorTask
>
queryWrapper
=
new
QueryWrapper
<>();
if
(!
StringUtils
.
isEmpty
(
businessLine
))
{
if
(!
StringUtils
.
isEmpty
(
businessLine
))
{
queryWrapper
.
eq
(
"business_line"
,
businessLine
);
queryWrapper
.
eq
(
"business_line"
,
businessLine
);
...
@@ -59,14 +59,18 @@ public class MonitorTaskController {
...
@@ -59,14 +59,18 @@ public class MonitorTaskController {
if
(!
StringUtils
.
isEmpty
(
serviceName
))
{
if
(!
StringUtils
.
isEmpty
(
serviceName
))
{
queryWrapper
.
eq
(
"service_name"
,
serviceName
);
queryWrapper
.
eq
(
"service_name"
,
serviceName
);
}
}
if
(!
StringUtils
.
isEmpty
(
owner
))
{
if
(!
StringUtils
.
isEmpty
(
taskName
))
{
queryWrapper
.
eq
(
"
owner"
,
owner
);
queryWrapper
.
eq
(
"
task_name"
,
taskName
);
}
}
queryWrapper
.
orderByDesc
(
"id"
);
queryWrapper
.
orderByDesc
(
"id"
);
IPage
<
MonitorTask
>
pageParam
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
MonitorTask
>
pageParam
=
new
Page
<>(
pageNum
,
pageSize
);
IPage
<
MonitorTask
>
monitorTaskIPage
=
monitorTaskService
.
page
(
pageParam
,
queryWrapper
);
IPage
<
MonitorTask
>
monitorTaskIPage
=
monitorTaskService
.
page
(
pageParam
,
queryWrapper
);
List
<
MonitorTask
>
monitorTaskList
=
monitorTaskIPage
.
getRecords
();
for
(
MonitorTask
monitorTask:
monitorTaskList
)
{
monitorTask
.
setDsName
(
monitorDataSourceService
.
getById
(
monitorTask
.
getDsId
()).
getName
());
}
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"list"
,
monitorTask
IPage
.
getRecords
()
);
resultMap
.
put
(
"list"
,
monitorTask
List
);
resultMap
.
put
(
"total"
,
monitorTaskIPage
.
getTotal
());
resultMap
.
put
(
"total"
,
monitorTaskIPage
.
getTotal
());
return
JsonResult
.
buildSuccessResult
(
resultMap
);
return
JsonResult
.
buildSuccessResult
(
resultMap
);
}
}
...
...
src/main/java/cn/qg/holmes/entity/monitor/MonitorTask.java
View file @
d9642a1b
...
@@ -92,4 +92,7 @@ public class MonitorTask {
...
@@ -92,4 +92,7 @@ public class MonitorTask {
@TableField
(
value
=
"`update_time`"
)
@TableField
(
value
=
"`update_time`"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updateTime
;
private
Date
updateTime
;
@TableField
(
exist
=
false
)
private
String
dsName
;
}
}
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