Vhevkpoint implemented but stiull some errors

This commit is contained in:
BuildTools
2020-11-30 13:22:53 +01:00
parent 082b30133c
commit 78ed2f75f3
3 changed files with 53 additions and 5 deletions

View File

@ -41,10 +41,15 @@ public class GroupController {
@RequestParam(name = "capacity", defaultValue = "true") @ApiParam(value = "Boolean if we want to have capacity field in response") Boolean capacity,
@RequestParam(name = "takenPlaces", defaultValue = "false") @ApiParam(value = "Boolean if we want to have respoonse with information about taken places by other students") Boolean takenPlaces) {
List<Groups> groups = this.groupService.getGroupsByCourse(id);
HashMap<Long, Integer> ammounts;
if (takenPlaces) {
ammounts = this.groupService.getTakenPlaces(groups);
HashMap<Long, Integer> ammounts = this.groupService.getTakenPlaces(groups);
if (capacity) {
return new ResponseEntity<>(GroupsMappers.mapToGetCourseGroupsWithCapacityResponse(groups, ammounts),
HttpStatus.OK);
}
return new ResponseEntity<>(GroupsMappers.mapToGetCourseGroupsDefaultResponse(groups, ammounts),
HttpStatus.OK);
}
if (capacity) {