Schedule taken places
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.entities.Groups;
|
||||
import com.plannaplan.types.GroupType;
|
||||
@ -20,11 +22,23 @@ public class AssignmentResponse {
|
||||
this.classes = classes == null ? null : new GroupWithCapacityResponse(classes);
|
||||
}
|
||||
|
||||
public AssignmentResponse(Course course, Groups lecture, Groups classes, HashMap<Long, Integer> ammounts) {
|
||||
this.id = course.getId();
|
||||
this.name = course.getName();
|
||||
this.lecture = lecture == null ? null : new GroupWithCapacityResponse(lecture, ammounts.get(lecture.getId()));
|
||||
this.classes = classes == null ? null : new GroupWithCapacityResponse(classes, ammounts.get(classes.getId()));
|
||||
}
|
||||
|
||||
public AssignmentResponse(Course course, Groups group) {
|
||||
this(course, group.getType() == GroupType.LECTURE ? group : null,
|
||||
group.getType() == GroupType.CLASS ? group : null);
|
||||
}
|
||||
|
||||
public AssignmentResponse(Course course, Groups group, HashMap<Long, Integer> ammounts) {
|
||||
this(course, group.getType() == GroupType.LECTURE ? group : null,
|
||||
group.getType() == GroupType.CLASS ? group : null, ammounts);
|
||||
}
|
||||
|
||||
public GroupWithCapacityResponse getLecture() {
|
||||
return this.lecture;
|
||||
}
|
||||
|
Reference in New Issue
Block a user