Vhevkpoint implemented but stiull some errors
This commit is contained in:
@ -80,20 +80,34 @@ public class GroupsMappers {
|
||||
}
|
||||
|
||||
public static CourseWithGroupsResponse<GroupWithCapacityResponse> mapToGetCourseGroupsWithCapacityResponse(
|
||||
List<Groups> groups) {
|
||||
List<Groups> groups, HashMap<Long, Integer> taken) {
|
||||
|
||||
List<GroupWithCapacityResponse> lectures = new ArrayList<>();
|
||||
List<GroupWithCapacityResponse> classes = new ArrayList<>();
|
||||
|
||||
groups.stream().forEach(group -> {
|
||||
if (group.getType() == GroupType.CLASS) {
|
||||
classes.add(new GroupWithCapacityResponse(group));
|
||||
if (taken != null) {
|
||||
classes.add(new GroupWithCapacityResponse(group, taken.get(group.getId())));
|
||||
} else {
|
||||
classes.add(new GroupWithCapacityResponse(group));
|
||||
}
|
||||
|
||||
} else {
|
||||
lectures.add(new GroupWithCapacityResponse(group));
|
||||
if (taken != null) {
|
||||
lectures.add(new GroupWithCapacityResponse(group, taken.get(group.getId())));
|
||||
} else {
|
||||
lectures.add(new GroupWithCapacityResponse(group));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return new CourseWithGroupsResponse<>(classes, lectures);
|
||||
}
|
||||
|
||||
public static CourseWithGroupsResponse<GroupWithCapacityResponse> mapToGetCourseGroupsWithCapacityResponse(
|
||||
List<Groups> groups) {
|
||||
return GroupsMappers.mapToGetCourseGroupsWithCapacityResponse(groups, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user