Courses Controller getCourses Mapping

This commit is contained in:
Filip Izydorczyk
2020-10-09 14:53:54 +02:00
parent f97e22fa5f
commit 29851dac0d
5 changed files with 91 additions and 9 deletions

View File

@ -0,0 +1,23 @@
package com.plannaplan.responses.models;
import com.plannaplan.entities.Course;
public class CoursesResponse {
private Long id;
private String name;
public CoursesResponse(Course course) {
this.id = course.getId() != null ? course.getId() : null;
this.name = course.getName() != null ? course.getName() : "";
}
public String getName() {
return name;
}
public Long getId() {
return id;
}
}