Class GithubGraphQLController

java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.GithubGraphQLController

@RequestMapping("/api/github/graphql/") @RestController public class GithubGraphQLController extends ApiController
  • Constructor Details

  • Method Details

    • getDefaultBranchName

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("defaultBranchName") public String getDefaultBranchName(Long courseId, String owner, String repo) throws Exception
      Return default branch name for a given repository.
      Parameters:
      courseId - the id of the course whose installation is being used for credentails
      owner - the owner of the repository
      repo - the name of the repository
      Returns:
      the default branch name
      Throws:
      Exception
    • getDefaultBasePermission

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("defaultbasepermission") public String getDefaultBasePermission(Long courseId) throws Exception
      Return default base permission for the GitHub organization associated with a course.
      Parameters:
      courseId - the id of the course whose installation is being used for credentials
      Returns:
      the default base permission
      Throws:
      Exception
    • getCommits

      @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("commits") public String getCommits(Long courseId, String owner, String repo, String branch, Integer first, String after) throws Exception
      Return commits for a given repository.
      Parameters:
      courseId - the id of the course whose installation is being used for credentails
      owner - the owner of the repository
      repo - the name of the repository
      branch - the branch name
      first - the number of commits to fetch
      after - pagination cursor
      Returns:
      commits as JSON
      Throws:
      Exception