diff --git a/restservice/src/main/java/com/plannaplan/controllers/CoursesController.java b/restservice/src/main/java/com/plannaplan/controllers/CoursesController.java index 18e0f48..011c707 100755 --- a/restservice/src/main/java/com/plannaplan/controllers/CoursesController.java +++ b/restservice/src/main/java/com/plannaplan/controllers/CoursesController.java @@ -9,7 +9,7 @@ import com.plannaplan.entities.Course; import com.plannaplan.responses.mappers.CoursesResponseMappers; import com.plannaplan.responses.models.CoursesDefaultResponse; import com.plannaplan.responses.models.CoursesWithGroupsResponse; -import com.plannaplan.responses.models.GroupDefaultResponse; +import com.plannaplan.responses.models.GroupWithCapacityResponse; import com.plannaplan.services.CourseService; import com.plannaplan.services.GroupService; import com.plannaplan.types.GroupType; @@ -53,16 +53,16 @@ public class CoursesController { final List response = new ArrayList<>(); courses.forEach(course -> { - final List lectures = new ArrayList<>(); - final List classes = new ArrayList<>(); + final List lectures = new ArrayList<>(); + final List classes = new ArrayList<>(); final HashMap ammounts = this.groupService.getTakenPlaces(course.getGroups()); course.getGroups().stream().forEach(group -> { if (group.getType() == GroupType.CLASS) { - classes.add(new GroupDefaultResponse(group, ammounts.get(group.getId()))); + classes.add(new GroupWithCapacityResponse(group, ammounts.get(group.getId()))); } else { - lectures.add(new GroupDefaultResponse(group, ammounts.get(group.getId()))); + lectures.add(new GroupWithCapacityResponse(group, ammounts.get(group.getId()))); } }); diff --git a/restservice/src/main/java/com/plannaplan/responses/models/CoursesWithGroupsResponse.java b/restservice/src/main/java/com/plannaplan/responses/models/CoursesWithGroupsResponse.java index 864618a..62820fa 100755 --- a/restservice/src/main/java/com/plannaplan/responses/models/CoursesWithGroupsResponse.java +++ b/restservice/src/main/java/com/plannaplan/responses/models/CoursesWithGroupsResponse.java @@ -12,32 +12,32 @@ import io.swagger.annotations.ApiModel; @ApiModel(description = "Response shows information about groups to given course.", value = "CoursesWithGroupsResponse") public class CoursesWithGroupsResponse extends CoursesResponse { - private List lectures = new ArrayList<>(); - private List classes = new ArrayList<>(); + private List lectures = new ArrayList<>(); + private List classes = new ArrayList<>(); public CoursesWithGroupsResponse(Course course) { super(course); course.getGroups().stream().forEach(group -> { if (group.getType() == GroupType.CLASS) { - this.classes.add(new GroupDefaultResponse(group)); + this.classes.add(new GroupWithCapacityResponse(group)); } else { - this.lectures.add(new GroupDefaultResponse(group)); + this.lectures.add(new GroupWithCapacityResponse(group)); } }); } - public CoursesWithGroupsResponse(Course course, List lectures, - List classes) { + public CoursesWithGroupsResponse(Course course, List lectures, + List classes) { super(course); this.lectures = lectures; this.classes = classes; } - public List getClasses() { + public List getClasses() { return this.classes; } - public List getLectures() { + public List getLectures() { return this.lectures; }