Update ProjectDto

This commit is contained in:
T-Midnight 2018-12-23 02:22:31 +04:00
parent 9e5f3d7247
commit c2a32d6c27

View File

@ -10,12 +10,12 @@ import java.util.List;
import static ru.ulstu.core.util.StreamApiUtils.convert; import static ru.ulstu.core.util.StreamApiUtils.convert;
public class ProjectDto { public class ProjectDto {
private final Integer id; private Integer id;
@NotEmpty @NotEmpty
private final String title; private String title;
private List<DeadlineDto> deadlines;
private final List<DeadlineDto> deadlines; public ProjectDto() {}
@JsonCreator @JsonCreator
public ProjectDto(@JsonProperty("id") Integer id, public ProjectDto(@JsonProperty("id") Integer id,
@ -26,6 +26,7 @@ public class ProjectDto {
this.deadlines = deadlines; this.deadlines = deadlines;
} }
public ProjectDto(Project project) { public ProjectDto(Project project) {
this.id = project.getId(); this.id = project.getId();
this.title = project.getTitle(); this.title = project.getTitle();
@ -39,4 +40,19 @@ public class ProjectDto {
public String getTitle() { public String getTitle() {
return title; return title;
} }
public void setId(Integer id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
public void setDeadlines(List<DeadlineDto> deadlines) {
this.deadlines = deadlines;
}
public List<DeadlineDto> getDeadlines() {
return deadlines;
}
} }