Added api endpoiunt mapper needs to be rewriteen
This commit is contained in:
@ -28,6 +28,9 @@ public class GroupDefaultResponse {
|
||||
@ApiModelProperty(value = "Value shows kind of group. The types are LECTURE or CLASS.")
|
||||
private GroupType type;
|
||||
|
||||
@ApiModelProperty(value = "Value shows how many places is already taken by other students.")
|
||||
private int takenPlaces;
|
||||
|
||||
public GroupDefaultResponse(Groups group) {
|
||||
this.id = group.getId() != null ? group.getId() : null;
|
||||
this.day = group.getDay() != null ? group.getDay().label : -1;
|
||||
@ -37,6 +40,11 @@ public class GroupDefaultResponse {
|
||||
this.type = group.getType() != null ? group.getType() : null;
|
||||
}
|
||||
|
||||
public GroupDefaultResponse(Groups group, int takenPlaces) {
|
||||
this(group);
|
||||
this.takenPlaces = takenPlaces;
|
||||
}
|
||||
|
||||
public GroupDefaultResponse(Assignment assignment) {
|
||||
this(assignment.getGroup());
|
||||
}
|
||||
@ -65,4 +73,8 @@ public class GroupDefaultResponse {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTakenPlaces() {
|
||||
return this.takenPlaces;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,11 @@ public class GroupWithCapacityResponse extends GroupDefaultResponse {
|
||||
this.capacity = group.getCapacity();
|
||||
}
|
||||
|
||||
public GroupWithCapacityResponse(Groups group, int takenPlaces) {
|
||||
super(group, takenPlaces);
|
||||
this.capacity = group.getCapacity();
|
||||
}
|
||||
|
||||
public GroupWithCapacityResponse(Assignment assignment) {
|
||||
this(assignment.getGroup());
|
||||
}
|
||||
|
Reference in New Issue
Block a user