Skip to content

Commit

Permalink
Merge branch 'release-2.4.1' into 'master'
Browse files Browse the repository at this point in the history
Release 2.4.1

See merge request hand-yanqianyun-yq-devops/gitlab-service!31
  • Loading branch information
王灏 committed May 5, 2023
2 parents 238bdb5 + 65d222b commit 085c2a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public ResponseEntity<Job> play(
@ApiParam(value = "jobId", required = true)
@PathVariable Integer jobId,
@ApiParam(value = "userId")
@RequestParam(value = "userId", required = false) Integer userId) {
return ResponseEntity.ok(jobService.play(projectId, userId, jobId));
@RequestParam(value = "userId", required = false) Integer userId,
AppExternalConfigDTO appExternalConfigDTO) {
return ResponseEntity.ok(jobService.play(projectId, userId, jobId, appExternalConfigDTO));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface JobService {
String queryTrace(Integer projectId, Integer userId, Integer jobId, AppExternalConfigDTO appExternalConfigDTO);


Job play(Integer projectId, Integer userId, Integer jobId);
Job play(Integer projectId, Integer userId, Integer jobId, AppExternalConfigDTO appExternalConfigDTO);

Job retry(Integer projectId, Integer userId, Integer jobId, AppExternalConfigDTO appExternalConfigDTO);
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ public Job retry(Integer projectId, Integer userId, Integer jobId, AppExternalCo
}

@Override
public Job play(Integer projectId, Integer userId, Integer jobId) {
public Job play(Integer projectId, Integer userId, Integer jobId, AppExternalConfigDTO appExternalConfigDTO) {
try {
return gitlab4jclient.getGitLabApi(userId)
GitLabApi gitLabApi;
if (appExternalConfigDTO == null || appExternalConfigDTO.getGitlabUrl() == null) {
gitLabApi = gitlab4jclient.getGitLabApi(userId);
} else {
gitLabApi = ExternalGitlabApiUtil.createGitLabApi(appExternalConfigDTO);
}
return gitLabApi
.getJobApi().playJob(projectId, jobId);
} catch (GitLabApiException e) {
throw new FeignException(e.getMessage(), e);
Expand Down

0 comments on commit 085c2a1

Please sign in to comment.