Skip to content

Commit

Permalink
ADM-834:[backend]feat: added api for domain url check
Browse files Browse the repository at this point in the history
  • Loading branch information
PengxiWPix committed Apr 7, 2024
1 parent 403ca2d commit a77a7c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/src/main/java/heartbeat/client/JiraFeignClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ CardHistoryResponseDTO getJiraCardHistoryByCount(URI baseUrl, @PathVariable Stri
@GetMapping(path = "rest/api/2/project/{projectIdOrKey}")
JiraBoardProject getProject(URI baseUrl, @PathVariable String projectIdOrKey, @RequestHeader String authorization);

@GetMapping(path = "/")
void getDomain(URI baseUrl);
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,25 @@ public String verify(BoardType boardType, BoardVerifyRequestParam boardVerifyReq
verifyBoardTypeIsJira(boardType);

try {
jiraFeignClient.getDomain(baseUrl);
}
catch (NotFoundException e) {
System.out.println(e);
}

try {
System.out.println(boardVerifyRequestParam.getBoardId());
System.out.println(boardVerifyRequestParam.getToken());

JiraBoardVerifyDTO jiraBoardVerifyDTO = jiraFeignClient.getBoard(baseUrl,
boardVerifyRequestParam.getBoardId(), boardVerifyRequestParam.getToken());



return jiraBoardVerifyDTO.getLocation().getProjectKey();
}
catch (NotFoundException e) {
System.out.println(e);
log.error("Failed to call Jira to verify board url, url: {}", baseUrl);
throw new NotFoundException("boardId is incorrect");
}
Expand Down

0 comments on commit a77a7c1

Please sign in to comment.