SeecoderGitlabApi.java 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 java.util.List;
  9. import java.util.Set;
  10. public interface SeecoderGitlabApi{
  11. public GitlabUserVO createGitlabUser(int userId,String username, String password, String email) throws SeecoderGitlabException;
  12. public boolean changePassword(int userId,String password) throws SeecoderGitlabException;
  13. public boolean deleteUser(int userId) throws SeecoderGitlabException;
  14. public String getUserEmail(int userId) throws SeecoderGitlabException;
  15. public GitlabGroup createGroup(String groupName) throws SeecoderGitlabException;
  16. public boolean addMember(int groupId, int userId, AccessLevelForm accessLevel) throws SeecoderGitlabException;
  17. public ProjectVO createProject(String projectName,VisibilityForm visibility) throws SeecoderGitlabException;
  18. public ProjectVO createPrivateProject(String projectName,VisibilityForm visibility, Integer userId) throws SeecoderGitlabException;
  19. public Integer forkProject(int projectId, int userId) throws SeecoderGitlabException;
  20. public Integer forkGroupProject(int projectId,int groupId) throws SeecoderGitlabException;
  21. public Set<DiffVO> compare(int projectId, String fromBash, String toBash) throws SeecoderGitlabException;
  22. public boolean addWebHook(int projectId,String url,boolean doPushEvents,boolean doIssueEvents,boolean doMergeRequestsEvents) throws SeecoderGitlabException;
  23. public boolean archiveProject(int projectId) throws SeecoderGitlabException;
  24. public String getProjectFile(int projectId, String branch,String path) throws SeecoderGitlabException;
  25. public String getProjectRawFile(int projectId,String commitOrBranchName,String path) throws SeecoderGitlabException;
  26. public CommitVO createCommit(int projectId, String branch,String commitMessage,String email,String username,List<CommitActionForm> actions) throws SeecoderGitlabException;
  27. public List<CommitVO> getAllCommitMessage(int projectId, String commitHash) throws SeecoderGitlabException;
  28. public List<BranchVO> getProjectBranches(int projectId) throws SeecoderGitlabException;
  29. public boolean addAuthorization(int projectId, int userId, AccessLevelForm accessLevel) throws GitLabApiException, SeecoderGitlabException;
  30. public List<ProjectVO> getAllProjectsByUserId(int userId) throws SeecoderGitlabException;
  31. public List<Integer> getJoinedUserByProject(int projectId) throws SeecoderGitlabException;
  32. }