91 lines
2.6 KiB
Java
Executable File
91 lines
2.6 KiB
Java
Executable File
package com.plannaplan.responses.models;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
import com.plannaplan.entities.Assignment;
|
|
import com.plannaplan.entities.Groups;
|
|
import com.plannaplan.types.GroupType;
|
|
|
|
import io.swagger.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
@ApiModel(description = "Response shows information about given group.", value = "GroupDefaultResponse")
|
|
public class GroupDefaultResponse {
|
|
|
|
@ApiModelProperty(value = "ID created by database.")
|
|
private Long id;
|
|
|
|
@ApiModelProperty(value = "Value shows what day when the course is. Example 0 is Monday.")
|
|
private int day;
|
|
|
|
@ApiModelProperty(value = "Value shows time when the course takes.")
|
|
private String time;
|
|
|
|
@ApiModelProperty(value = "Value shows time when the course ends.")
|
|
private String endTime;
|
|
|
|
@ApiModelProperty(value = "Value shows degree, name and surname.")
|
|
private String lecturer;
|
|
|
|
@ApiModelProperty(value = "Value shows room where the class takes.")
|
|
private String room;
|
|
|
|
@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 Integer takenPlaces;
|
|
|
|
public GroupDefaultResponse(Groups group) {
|
|
this.id = group.getId() != null ? group.getId() : null;
|
|
this.day = group.getDay() != null ? group.getDay().label : -1;
|
|
this.time = group.getTimeString() != null ? group.getTimeString() : "";
|
|
this.endTime = group.getEndTimeString() != null ? group.getEndTimeString() : "";
|
|
this.lecturer = group.getLecturer() != null ? group.getLecturer().toString() : "";
|
|
this.room = group.getRoom() != null ? group.getRoom() : "";
|
|
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());
|
|
}
|
|
|
|
public GroupType getType() {
|
|
return type;
|
|
}
|
|
|
|
public String getRoom() {
|
|
return room;
|
|
}
|
|
|
|
public String getLecturer() {
|
|
return lecturer;
|
|
}
|
|
|
|
public String getTime() {
|
|
return time;
|
|
}
|
|
|
|
public String getEndTime() {
|
|
return endTime;
|
|
}
|
|
|
|
public int getDay() {
|
|
return day;
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public Integer getTakenPlaces() {
|
|
return this.takenPlaces;
|
|
}
|
|
|
|
}
|