controllers docs checkpoint

This commit is contained in:
Filip Izydorczyk
2021-01-16 13:57:58 +01:00
parent e600e84ae2
commit 9372ea5562
7 changed files with 137 additions and 14 deletions

View File

@ -27,9 +27,12 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/**
* Rest controller to Groups related endpoints. More detailed api docs is
* available via swagger
*/
@RestController
@CrossOrigin
@RequestMapping("/api/" + App.API_VERSION + "/groups")
@Api(tags = {
"Group" }, value = "Group", description = "Enpoints to deal with gorups. Group is related directly to course and can be either class and lecture")
@ -37,6 +40,12 @@ public class GroupController {
@Autowired
private GroupService groupService;
/**
* @param id course to display with groups
* @param capacity should include capaticty in response
* @param takenPlaces should include takenPlaces in response
* @return CourseWithGroupsResponse
*/
@GetMapping("/course/{id}")
@ApiOperation(value = "Return list of lectures and classes (if present) given course")
public ResponseEntity<CourseWithGroupsResponse<? extends GroupDefaultResponse>> getCourses(
@ -61,6 +70,11 @@ public class GroupController {
return new ResponseEntity<>(GroupsMappers.mapToGetCourseGroupsDefaultResponse(groups), HttpStatus.OK);
}
/**
* @param id group id to change capacity
* @param newcapacity new capacity to insert
* @return ResponseEntity was action success
*/
@PutMapping("/{id}/capacity")
@PreAuthorize("hasRole('ROLE_DEANERY')")
@ApiOperation(value = "Change capacity of given group. You need to provide DEANERY token to be ale to change capacity")