Chenged newest plan response
This commit is contained in:
@ -1,11 +1,41 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.Assignment;
|
||||
import com.plannaplan.entities.Course;
|
||||
import com.plannaplan.entities.Groups;
|
||||
import com.plannaplan.types.GroupType;
|
||||
|
||||
public class GetCurrentAssignmentsResponse extends WithCapacityGroupResponse {
|
||||
public class GetCurrentAssignmentsResponse {
|
||||
private Long id;
|
||||
private String name;
|
||||
private WithCapacityGroupResponse classes;
|
||||
private WithCapacityGroupResponse lecture;
|
||||
|
||||
public GetCurrentAssignmentsResponse(Assignment assignment) {
|
||||
super(assignment);
|
||||
public GetCurrentAssignmentsResponse(Course course, Groups lecture, Groups classes) {
|
||||
this.id = course.getId();
|
||||
this.name = course.getName();
|
||||
this.lecture = lecture == null ? null : new WithCapacityGroupResponse(lecture);
|
||||
this.classes = classes == null ? null : new WithCapacityGroupResponse(classes);
|
||||
}
|
||||
|
||||
public GetCurrentAssignmentsResponse(Course course, Groups group) {
|
||||
this(course, group.getType() == GroupType.LECTURE ? group : null,
|
||||
group.getType() == GroupType.CLASS ? group : null);
|
||||
}
|
||||
|
||||
public WithCapacityGroupResponse getLecture() {
|
||||
return this.lecture;
|
||||
}
|
||||
|
||||
public WithCapacityGroupResponse getClasses() {
|
||||
return this.classes;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user