From e85c814f706449cbf1e812bb155e1f6877c2a542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:46:42 +0300 Subject: [PATCH] #96 project comment added --- src/main/java/ru/ulstu/project/model/Project.java | 12 ++++++++++++ src/main/java/ru/ulstu/project/model/ProjectDto.java | 12 ++++++++++++ src/main/resources/templates/projects/project.html | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index de2db7a..4432224 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -5,6 +5,7 @@ import ru.ulstu.core.model.BaseEntity; import ru.ulstu.deadline.model.Deadline; import javax.persistence.*; +import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; @@ -35,6 +36,9 @@ public class Project extends BaseEntity { @Enumerated(value = EnumType.STRING) private ProjectStatus status = ProjectStatus.APPLICATION; + @NotNull + private String comment; + @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name = "project_id") private List deadlines = new ArrayList<>(); @@ -55,6 +59,14 @@ public class Project extends BaseEntity { this.status = status; } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + public List getDeadlines() { return deadlines; } diff --git a/src/main/java/ru/ulstu/project/model/ProjectDto.java b/src/main/java/ru/ulstu/project/model/ProjectDto.java index adb8979..237be0f 100644 --- a/src/main/java/ru/ulstu/project/model/ProjectDto.java +++ b/src/main/java/ru/ulstu/project/model/ProjectDto.java @@ -14,6 +14,7 @@ public class ProjectDto { @NotEmpty private String title; private Project.ProjectStatus status; + private String comment; private List deadlines = new ArrayList<>(); public ProjectDto() { @@ -27,10 +28,12 @@ public class ProjectDto { public ProjectDto(@JsonProperty("id") Integer id, @JsonProperty("title") String title, @JsonProperty("status") Project.ProjectStatus status, + @JsonProperty("comment") String comment, @JsonProperty("deadlines") List deadlines) { this.id = id; this.title = title; this.status = status; + this.comment = comment; this.deadlines = deadlines; } @@ -39,6 +42,7 @@ public class ProjectDto { this.id = project.getId(); this.title = project.getTitle(); this.status = project.getStatus(); + this.comment = project.getComment(); this.deadlines = project.getDeadlines(); } @@ -66,6 +70,14 @@ public class ProjectDto { this.status = status; } + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + public List getDeadlines() { return deadlines; } diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index cce6df8..8374df1 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -42,6 +42,12 @@ + +
+ + +