2020-10-08 15:57:42 +02:00
|
|
|
package com.plannaplan.responses.models;
|
|
|
|
|
2020-10-08 16:41:13 +02:00
|
|
|
import com.plannaplan.entities.Assignment;
|
2020-10-08 15:57:42 +02:00
|
|
|
import com.plannaplan.entities.Groups;
|
|
|
|
import com.plannaplan.types.GroupType;
|
|
|
|
|
2020-11-08 16:55:56 +01:00
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
|
|
|
|
@ApiModel(description = "Response shows information about given group", value = "DefaultGroupResponse")
|
2020-10-13 17:07:04 +02:00
|
|
|
public class DefaultGroupResponse {
|
2020-10-08 15:57:42 +02:00
|
|
|
|
2020-11-08 16:55:56 +01:00
|
|
|
@ApiModelProperty(value = "ID created by database.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private Long id;
|
2020-11-08 16:55:56 +01:00
|
|
|
|
|
|
|
@ApiModelProperty(value = "Value shows what day when the course is. Example 0 is Monday.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private int day;
|
2020-11-08 16:55:56 +01:00
|
|
|
|
|
|
|
@ApiModelProperty(value = "Value shows time when the course takes.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private String time;
|
2020-11-08 16:55:56 +01:00
|
|
|
|
|
|
|
@ApiModelProperty(value = "Value shows degree, name and surname.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private String lecturer;
|
2020-11-08 16:55:56 +01:00
|
|
|
|
|
|
|
@ApiModelProperty(value = "Value shows room where the class takes.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private String room;
|
2020-11-08 16:55:56 +01:00
|
|
|
|
|
|
|
@ApiModelProperty(value = "Value shows kind of group. The types are LECTURE or CLASS.")
|
2020-10-08 15:57:42 +02:00
|
|
|
private GroupType type;
|
|
|
|
|
2020-10-13 17:07:04 +02:00
|
|
|
public DefaultGroupResponse(Groups group) {
|
2020-10-08 16:41:13 +02:00
|
|
|
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.lecturer = group.getLecturer() != null ? group.getLecturer().toString() : "";
|
|
|
|
this.room = group.getRoom() != null ? group.getRoom() : "";
|
|
|
|
this.type = group.getType() != null ? group.getType() : null;
|
|
|
|
}
|
|
|
|
|
2020-10-13 17:07:04 +02:00
|
|
|
public DefaultGroupResponse(Assignment assignment) {
|
2020-10-08 16:41:13 +02:00
|
|
|
this(assignment.getGroup());
|
2020-10-08 15:57:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public GroupType getType() {
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getRoom() {
|
|
|
|
return room;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLecturer() {
|
|
|
|
return lecturer;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getTime() {
|
|
|
|
return time;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getDay() {
|
|
|
|
return day;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Long getId() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|