Class RepositoryController
java.lang.Object
edu.ucsb.cs156.frontiers.controllers.ApiController
edu.ucsb.cs156.frontiers.controllers.RepositoryController
@RestController
@RequestMapping("/api/repos")
public class RepositoryController
extends ApiController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateRepos(Long courseId, String repoPrefix, Optional<Boolean> isPrivate, RepositoryPermissions permissions, RepositoryCreationOption creationOption) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.createTeamRepos(Long courseId, String repoPrefix, Optional<Boolean> isPrivate, RepositoryPermissions permissions) Fires a job that creates team repos shared by all TeamMembers of each Team in a Course .Methods inherited from class edu.ucsb.cs156.frontiers.controllers.ApiController
doesCurrentUserHaveRole, genericMessage, getCurrentUser, handleEntityNotFoundException, handleIllegalArgument, handleNoLinkedOrgException, handleUnsupportedOperation, handleValidationException, isCurrentUserAdmin
-
Constructor Details
-
RepositoryController
public RepositoryController()
-
-
Method Details
-
createRepos
@PostMapping("/createRepos") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public Job createRepos(@RequestParam Long courseId, @RequestParam String repoPrefix, @RequestParam Optional<Boolean> isPrivate, @RequestParam RepositoryPermissions permissions, @RequestParam(required=false,defaultValue="STUDENTS_ONLY") RepositoryCreationOption creationOption) Fires a job that creates a repo for every RosterStudent with a linked user with a GitHub account.- Parameters:
courseId- ID of course to create repos forrepoPrefix- each repo created will begin with this prefix, followed by a dash and the student's GitHub usernameisPrivate- determines whether the repository being created is private- Returns:
- the
Jobstarted to create the repos.
-
createTeamRepos
@PostMapping("/createTeamRepos") @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)") public Job createTeamRepos(@RequestParam Long courseId, @RequestParam String repoPrefix, @RequestParam Optional<Boolean> isPrivate, @RequestParam RepositoryPermissions permissions) Fires a job that creates team repos shared by all TeamMembers of each Team in a Course .- Parameters:
courseId- ID of course to create team repos forrepoPrefix- each team repo created will begin with this prefix, followed by a dash and the team's nameisPrivate- determines whether the repository being created is private- Returns:
- the
Jobstarted to create the repos.
-