Package com.plannaplan.controllers
Class GroupController
java.lang.Object
com.plannaplan.controllers.GroupController
@RestController
@CrossOrigin
@RequestMapping("/api/v1/groups")
public class GroupController
extends java.lang.Object
Rest controller to Groups related endpoints. More detailed api docs is
available via swagger
-
Constructor Summary
Constructors Constructor Description GroupController()
-
Method Summary
Modifier and Type Method Description org.springframework.http.ResponseEntity<CourseWithGroupsResponse<? extends GroupDefaultResponse>>
getCourses(java.lang.Long id, java.lang.Boolean capacity, java.lang.Boolean takenPlaces)
org.springframework.http.ResponseEntity<java.lang.String>
updateCapacity(java.lang.Long id, java.lang.Integer newcapacity)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
GroupController
public GroupController()
-
-
Method Details
-
getCourses
@GetMapping("/course/{id}") public org.springframework.http.ResponseEntity<CourseWithGroupsResponse<? extends GroupDefaultResponse>> getCourses(@PathVariable(name="id") java.lang.Long id, @RequestParam(name="capacity",defaultValue="true") java.lang.Boolean capacity, @RequestParam(name="takenPlaces",defaultValue="false") java.lang.Boolean takenPlaces)- Parameters:
id
- course to display with groupscapacity
- should include capaticty in responsetakenPlaces
- should include takenPlaces in response- Returns:
- CourseWithGroupsResponse
-
updateCapacity
@PutMapping("/{id}/capacity") @PreAuthorize("hasRole(\'ROLE_DEANERY\')") public org.springframework.http.ResponseEntity<java.lang.String> updateCapacity(@PathVariable(name="id",required=true) java.lang.Long id, @RequestParam(name="newcapacity",required=true) java.lang.Integer newcapacity)- Parameters:
id
- group id to change capacitynewcapacity
- new capacity to insert- Returns:
- ResponseEntity was action success
-