Added Assignment Response Model

This commit is contained in:
Filip Izydorczyk
2020-10-08 15:57:42 +02:00
parent f9706e0e01
commit 9d97306e5c
3 changed files with 83 additions and 1 deletions

View File

@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
@CrossOrigin
public class TokenController {
public static String SERVICE_URL = "http://localhost:3000";
private final static String SERVICE_URL = "http://localhost:3000";
@Autowired
private UserService userService;

View File

@ -0,0 +1,54 @@
package com.plannaplan.responses.models;
import com.plannaplan.entities.Groups;
import com.plannaplan.types.GroupType;
public class AssignmentResponse {
private Long id;
private int day;
private String time;
private String lecturer;
private String room;
private int capacity;
private GroupType type;
public AssignmentResponse(Groups group) {
this.id = group.getId();
this.day = group.getDay().label;
this.time = group.getTimeString();
this.lecturer = group.getLecturer().toString();
this.room = group.getRoom();
this.capacity = group.getCapacity();
this.type = group.getType();
}
public GroupType getType() {
return type;
}
public int getCapacity() {
return capacity;
}
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;
}
}