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
eb9c3c09
Commit
eb9c3c09
authored
Jun 08, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增删除dingrobot接口以及获取未解决BUG列表接口
parent
55047d3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
PipelineController.java
...va/cn/qg/holmes/controller/gitlab/PipelineController.java
+16
-0
JiraController.java
...ain/java/cn/qg/holmes/controller/jira/JiraController.java
+32
-0
No files found.
src/main/java/cn/qg/holmes/controller/gitlab/PipelineController.java
View file @
eb9c3c09
...
...
@@ -142,4 +142,20 @@ public class PipelineController {
return
JsonResult
.
buildSuccessResult
(
pipelineService
.
saveOrUpdateBatch
(
pipelineList
));
}
/**
* 删除pipeline
* @param dingRobotId
* @return
*/
@Transactional
@GetMapping
(
"/delete"
)
public
JsonResult
deletePipeline
(
@RequestParam
Integer
dingRobotId
)
{
if
(
dingRobotService
.
getById
(
dingRobotId
)
!=
null
)
{
dingRobotService
.
removeById
(
dingRobotId
);
}
QueryWrapper
<
Pipeline
>
pipelineQueryWrapper
=
new
QueryWrapper
<>();
pipelineQueryWrapper
.
eq
(
"ding_robot_id"
,
dingRobotId
);
return
JsonResult
.
buildSuccessResult
(
pipelineService
.
remove
(
pipelineQueryWrapper
));
}
}
src/main/java/cn/qg/holmes/controller/jira/JiraController.java
View file @
eb9c3c09
...
...
@@ -175,4 +175,36 @@ public class JiraController {
String
markdownMsg
=
DingdingUtils
.
buildSmokingResultMarkdownMsg
(
issues
,
sendSmokingResultVo
.
getResult
(),
sendSmokingResultVo
.
getRisk
());
return
JsonResult
.
buildSuccessResult
(
DingdingUtils
.
sendToDingding
(
markdownMsg
,
sendSmokingResultVo
.
getWebhook
()));
}
/**
* 根据JIRA项目名称和项目关键字获取未解决BUG
* @param jiraProjectKey
* @param projectName
* @return
* @throws Exception
*/
@GetMapping
(
"/issue/list"
)
public
JsonResult
getUnsolvedByProject
(
@RequestParam
String
jiraProjectKey
,
@RequestParam
String
projectName
,
@RequestParam
boolean
unsolved
)
throws
Exception
{
String
JQL
=
null
;
if
(!
unsolved
)
{
JQL
=
"project = "
+
jiraProjectKey
+
" AND text ~ \""
+
projectName
+
"\" ORDER BY priority DESC, updated DESC"
;
}
else
{
JQL
=
"project = "
+
jiraProjectKey
+
" AND resolution = Unresolved AND text ~ \""
+
projectName
+
"\" ORDER BY priority DESC, updated DESC"
;
}
Iterable
<
Issue
>
issues
=
jiraIssueService
.
getIssueListByJQL
(
JQL
);
List
<
Map
<
String
,
Object
>>
mapList
=
new
ArrayList
<>();
for
(
Issue
issue:
issues
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"key"
,
issue
.
getKey
());
map
.
put
(
"summary"
,
issue
.
getSummary
());
map
.
put
(
"reporter"
,
issue
.
getReporter
().
getDisplayName
());
map
.
put
(
"assignee"
,
issue
.
getAssignee
().
getDisplayName
());
map
.
put
(
"priority"
,
issue
.
getPriority
().
getName
());
map
.
put
(
"status"
,
issue
.
getStatus
().
getName
());
mapList
.
add
(
map
);
}
return
JsonResult
.
buildSuccessResult
(
mapList
);
}
}
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