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 Summary
ConstructorsConstructorDescriptionGithubGraphQLController
(GithubGraphQLService gitHubGraphQLService, CourseRepository courseRepository) -
Method Summary
Modifier and TypeMethodDescriptionReturn default branch name for a given repository.getDefaultBranchName
(Long courseId, String owner, String repo) Return default branch name for a given repository.Methods inherited from class edu.ucsb.cs156.frontiers.controllers.ApiController
doesCurrentUserHaveRole, genericMessage, getCurrentUser, handleEntityNotFoundException, handleIllegalArgument, handleNoLinkedOrgException, handleUnsupportedOperation, isCurrentUserAdmin
-
Constructor Details
-
GithubGraphQLController
public GithubGraphQLController(@Autowired GithubGraphQLService gitHubGraphQLService, @Autowired CourseRepository courseRepository)
-
-
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 credentailsowner
- the owner of the repositoryrepo
- the name of the repository- Returns:
- the default branch name
- Throws:
Exception
-
getCommits
@PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") @GetMapping("commits") public String getCommits(Long courseId, String owner, String repo, String branch, Integer first, @RequestParam(name="after",required=false) String after) throws Exception Return default branch name for a given repository.- Parameters:
courseId
- the id of the course whose installation is being used for credentailsowner
- the owner of the repositoryrepo
- the name of the repository- Returns:
- the default branch name
- Throws:
Exception
-