new endpoint
This commit is contained in:
@ -0,0 +1,71 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.Assignment;
|
||||
import com.plannaplan.entities.Groups;
|
||||
|
||||
/**
|
||||
* Assignment detailed response for api
|
||||
*/
|
||||
public class AssignmentDetailedResponse {
|
||||
public Long id;
|
||||
public String name;
|
||||
private int day;
|
||||
private String time;
|
||||
private String endTime;
|
||||
private String lecturer;
|
||||
|
||||
/**
|
||||
* @param assignment Assignment instance to map
|
||||
*/
|
||||
public AssignmentDetailedResponse(Assignment assignment) {
|
||||
final Groups group = assignment.getGroup();
|
||||
this.id = assignment.getId();
|
||||
this.name = group.getCourseId().getName();
|
||||
this.day = group.getDay().label;
|
||||
this.time = group.getTimeString();
|
||||
this.endTime = group.getEndTimeString();
|
||||
this.lecturer = group.getLecturer().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return day as a value from 0-6
|
||||
*/
|
||||
public int getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return lecturer string fromated
|
||||
*/
|
||||
public String getLecturer() {
|
||||
return lecturer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return time formated string
|
||||
*/
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return time formated string
|
||||
*/
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return name of course that group belongs to
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return db id of assignment
|
||||
*/
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user