#96 project comment added

merge-requests/57/head
Васин Антон 5 years ago
parent 255692d6ea
commit e85c814f70

@ -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<Deadline> 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<Deadline> getDeadlines() {
return deadlines;
}

@ -14,6 +14,7 @@ public class ProjectDto {
@NotEmpty
private String title;
private Project.ProjectStatus status;
private String comment;
private List<Deadline> 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<Deadline> 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<Deadline> getDeadlines() {
return deadlines;
}

@ -42,6 +42,12 @@
</option>
</select>
</div>
<div class="form-group">
<label for="comment">Комментарий:</label>
<textarea class="form-control" rows="3" id="comment"
th:field="*{comment}"></textarea>
</div>
</div>
<div class="clearfix"></div>

Loading…
Cancel
Save