|
@@ -219,7 +219,18 @@ public class ProjectServiceImpl implements ProjectService {
|
|
|
return Collections.emptyList();
|
|
return Collections.emptyList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private CommitVO castCommitToVO(Commit commit,String branch) {
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<CommitVO> getCommitsByBranch(int projectId, String branchName) throws GitLabApiException {
|
|
|
|
|
+ List<Commit> commits=gitlabApi.getCommitsApi().getCommits(projectId, branchName,null,null);
|
|
|
|
|
+ if (commits.size() != 0){
|
|
|
|
|
+ return commits.stream()
|
|
|
|
|
+ .map(com -> castCommitToVO(com,branchName))
|
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private CommitVO castCommitToVO(Commit commit, String branch) {
|
|
|
return CommitVO.builder()
|
|
return CommitVO.builder()
|
|
|
.branch(branch)
|
|
.branch(branch)
|
|
|
// .author(String.valueOf(commit.getAuthor().getId())) //todo 好像没这些属性
|
|
// .author(String.valueOf(commit.getAuthor().getId())) //todo 好像没这些属性
|