Added api endpoiunt mapper needs to be rewriteen

This commit is contained in:
BuildTools
2020-11-20 16:20:38 +01:00
parent b4bb13f2dd
commit 9d3500c1fb
3 changed files with 19 additions and 1 deletions

View File

@ -37,7 +37,8 @@ public class GroupController {
@ApiOperation(value = "Return list of lectures and classes (if present) given course")
public ResponseEntity<CourseWithGroupsResponse<? extends GroupDefaultResponse>> getCourses(
@PathVariable(name = "id") Long id,
@RequestParam(name = "capacity", defaultValue = "true") @ApiParam(value = "Boolean if we want to have capacity field in response") Boolean capacity) {
@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);
if (capacity) {
return new ResponseEntity<>(GroupsMappers.mapToGetCourseGroupsWithCapacityResponse(groups), HttpStatus.OK);