SeecoderGitlabApi.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package com.nju.edu.gitlab;
  2. import com.nju.edu.gitlab.dto.commit.CommitActionForm;
  3. import com.nju.edu.gitlab.dto.member.AccessLevelForm;
  4. import com.nju.edu.gitlab.dto.project.VisibilityForm;
  5. import com.nju.edu.gitlab.vo.*;
  6. import com.nju.edu.gitlab.vo.commit.CommitVO;
  7. import org.gitlab4j.api.GitLabApiException;
  8. import org.gitlab4j.api.models.User;
  9. import java.util.List;
  10. import java.util.Set;
  11. public interface SeecoderGitlabApi{
  12. public GitlabUserVO createGitlabUser(int userId,String username, String password, String email) throws SeecoderGitlabException;
  13. public boolean changePassword(int userId,String password) throws SeecoderGitlabException;
  14. public boolean changeUserName(int userId, String password, String username) throws SeecoderGitlabException;
  15. public boolean deleteUser(int userId) throws SeecoderGitlabException;
  16. public String getUserEmail(int userId) throws SeecoderGitlabException;
  17. public User getUserByUserName(String userName) throws SeecoderGitlabException;
  18. public GitlabUserVO getUserByUserNameNew(String userName) throws SeecoderGitlabException;
  19. public GitlabGroup createGroup(String groupName) throws SeecoderGitlabException;
  20. public boolean addMember(int groupId, int userId, AccessLevelForm accessLevel) throws SeecoderGitlabException;
  21. public ProjectVO createProject(String projectName,VisibilityForm visibility) throws SeecoderGitlabException;
  22. public ProjectVO createPrivateProject(String projectName,VisibilityForm visibility, Integer userId) throws SeecoderGitlabException;
  23. public boolean deleteProject(int projectId) throws SeecoderGitlabException;
  24. public Integer forkProject(int projectId, int userId) throws SeecoderGitlabException;
  25. public Integer forkGroupProject(int projectId,int groupId) throws SeecoderGitlabException;
  26. public Set<DiffVO> compare(int projectId, String fromBash, String toBash) throws SeecoderGitlabException;
  27. public boolean addWebHook(int projectId,String url,boolean doPushEvents,boolean doIssueEvents,boolean doMergeRequestsEvents) throws SeecoderGitlabException;
  28. public boolean archiveProject(int projectId) throws SeecoderGitlabException;
  29. public String getProjectFile(int projectId, String branch,String path) throws SeecoderGitlabException;
  30. public String getProjectRawFile(int projectId,String commitOrBranchName,String path) throws SeecoderGitlabException;
  31. public CommitVO createCommit(int projectId, String branch,String commitMessage,String email,String username,List<CommitActionForm> actions) throws SeecoderGitlabException;
  32. public List<CommitVO> getAllCommitMessage(int projectId, String commitHash) throws SeecoderGitlabException;
  33. public List<CommitVO> getCommitsByBranch(int projectId, String branchName) throws SeecoderGitlabException;
  34. public CommitVO getCommitByHash(int projectId, String hash) throws SeecoderGitlabException;
  35. public List<BranchVO> getProjectBranches(int projectId) throws SeecoderGitlabException;
  36. public boolean addAuthorization(int projectId, int userId, AccessLevelForm accessLevel) throws GitLabApiException, SeecoderGitlabException;
  37. public List<ProjectVO> getAllProjectsByUserId(int userId) throws SeecoderGitlabException;
  38. public List<Integer> getJoinedUserByProject(int projectId) throws SeecoderGitlabException;
  39. public List<String> getFilePaths(int projectId, String basePath, String branch) throws SeecoderGitlabException;
  40. }