|
|
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
import org.hibernate.validator.constraints.NotEmpty;
|
|
|
|
|
import ru.ulstu.deadline.model.Deadline;
|
|
|
|
|
import ru.ulstu.grant.model.GrantDto;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -14,8 +15,10 @@ public class ProjectDto {
|
|
|
|
|
@NotEmpty
|
|
|
|
|
private String title;
|
|
|
|
|
private Project.ProjectStatus status;
|
|
|
|
|
private String comment;
|
|
|
|
|
private String description;
|
|
|
|
|
private List<Deadline> deadlines = new ArrayList<>();
|
|
|
|
|
private GrantDto grant;
|
|
|
|
|
private String repository;
|
|
|
|
|
|
|
|
|
|
public ProjectDto() {
|
|
|
|
|
}
|
|
|
|
@ -28,12 +31,16 @@ public class ProjectDto {
|
|
|
|
|
public ProjectDto(@JsonProperty("id") Integer id,
|
|
|
|
|
@JsonProperty("title") String title,
|
|
|
|
|
@JsonProperty("status") Project.ProjectStatus status,
|
|
|
|
|
@JsonProperty("comment") String comment,
|
|
|
|
|
@JsonProperty("description") String description,
|
|
|
|
|
@JsonProperty("grant") GrantDto grant,
|
|
|
|
|
@JsonProperty("repository") String repository,
|
|
|
|
|
@JsonProperty("deadlines") List<Deadline> deadlines) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.title = title;
|
|
|
|
|
this.status = status;
|
|
|
|
|
this.comment = comment;
|
|
|
|
|
this.description = description;
|
|
|
|
|
this.grant = grant;
|
|
|
|
|
this.repository = repository;
|
|
|
|
|
this.deadlines = deadlines;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -42,7 +49,9 @@ public class ProjectDto {
|
|
|
|
|
this.id = project.getId();
|
|
|
|
|
this.title = project.getTitle();
|
|
|
|
|
this.status = project.getStatus();
|
|
|
|
|
this.comment = project.getComment();
|
|
|
|
|
this.description = project.getDescription();
|
|
|
|
|
this.grant = project.getGrant() == null ? null : new GrantDto(project.getGrant());
|
|
|
|
|
this.repository = project.getRepository();
|
|
|
|
|
this.deadlines = project.getDeadlines();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -70,12 +79,28 @@ public class ProjectDto {
|
|
|
|
|
this.status = status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getComment() {
|
|
|
|
|
return comment;
|
|
|
|
|
public String getDescription() {
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setComment(String comment) {
|
|
|
|
|
this.comment = comment;
|
|
|
|
|
public void setDescription(String description) {
|
|
|
|
|
this.description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GrantDto getGrant() {
|
|
|
|
|
return grant;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setGrant(GrantDto grant) {
|
|
|
|
|
this.grant = grant;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getRepository() {
|
|
|
|
|
return repository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setRepository(String repository) {
|
|
|
|
|
this.repository = repository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<Deadline> getDeadlines() {
|
|
|
|
|