|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.hibernate.validator.constraints.NotEmpty;
|
|
|
|
import org.hibernate.validator.constraints.NotEmpty;
|
|
|
|
import ru.ulstu.deadline.model.Deadline;
|
|
|
|
import ru.ulstu.deadline.model.Deadline;
|
|
|
|
|
|
|
|
import ru.ulstu.file.model.FileDataDto;
|
|
|
|
import ru.ulstu.paper.model.Paper;
|
|
|
|
import ru.ulstu.paper.model.Paper;
|
|
|
|
import ru.ulstu.project.model.ProjectDto;
|
|
|
|
import ru.ulstu.project.model.ProjectDto;
|
|
|
|
import ru.ulstu.user.model.UserDto;
|
|
|
|
import ru.ulstu.user.model.UserDto;
|
|
|
@ -25,7 +26,7 @@ public class GrantDto {
|
|
|
|
private Grant.GrantStatus status;
|
|
|
|
private Grant.GrantStatus status;
|
|
|
|
private List<Deadline> deadlines = new ArrayList<>();
|
|
|
|
private List<Deadline> deadlines = new ArrayList<>();
|
|
|
|
private String comment;
|
|
|
|
private String comment;
|
|
|
|
private String applicationFileName;
|
|
|
|
private List<FileDataDto> files = new ArrayList<>();
|
|
|
|
private ProjectDto project;
|
|
|
|
private ProjectDto project;
|
|
|
|
private Set<Integer> authorIds;
|
|
|
|
private Set<Integer> authorIds;
|
|
|
|
private Set<UserDto> authors;
|
|
|
|
private Set<UserDto> authors;
|
|
|
@ -47,6 +48,7 @@ public class GrantDto {
|
|
|
|
@JsonProperty("status") Grant.GrantStatus status,
|
|
|
|
@JsonProperty("status") Grant.GrantStatus status,
|
|
|
|
@JsonProperty("deadlines") List<Deadline> deadlines,
|
|
|
|
@JsonProperty("deadlines") List<Deadline> deadlines,
|
|
|
|
@JsonProperty("comment") String comment,
|
|
|
|
@JsonProperty("comment") String comment,
|
|
|
|
|
|
|
|
@JsonProperty("files") List<FileDataDto> files,
|
|
|
|
@JsonProperty("project") ProjectDto project,
|
|
|
|
@JsonProperty("project") ProjectDto project,
|
|
|
|
@JsonProperty("authorIds") Set<Integer> authorIds,
|
|
|
|
@JsonProperty("authorIds") Set<Integer> authorIds,
|
|
|
|
@JsonProperty("authors") Set<UserDto> authors,
|
|
|
|
@JsonProperty("authors") Set<UserDto> authors,
|
|
|
@ -61,8 +63,9 @@ public class GrantDto {
|
|
|
|
this.status = status;
|
|
|
|
this.status = status;
|
|
|
|
this.deadlines = deadlines;
|
|
|
|
this.deadlines = deadlines;
|
|
|
|
this.comment = comment;
|
|
|
|
this.comment = comment;
|
|
|
|
this.applicationFileName = null;
|
|
|
|
this.files = files;
|
|
|
|
this.project = project;
|
|
|
|
this.project = project;
|
|
|
|
|
|
|
|
this.authorIds = authorIds;
|
|
|
|
this.authors = authors;
|
|
|
|
this.authors = authors;
|
|
|
|
this.leaderId = leaderId;
|
|
|
|
this.leaderId = leaderId;
|
|
|
|
this.wasLeader = wasLeader;
|
|
|
|
this.wasLeader = wasLeader;
|
|
|
@ -78,8 +81,8 @@ public class GrantDto {
|
|
|
|
this.status = grant.getStatus();
|
|
|
|
this.status = grant.getStatus();
|
|
|
|
this.deadlines = grant.getDeadlines();
|
|
|
|
this.deadlines = grant.getDeadlines();
|
|
|
|
this.comment = grant.getComment();
|
|
|
|
this.comment = grant.getComment();
|
|
|
|
|
|
|
|
this.files = convert(grant.getFiles(), FileDataDto::new);
|
|
|
|
this.project = grant.getProject() == null ? null : new ProjectDto(grant.getProject());
|
|
|
|
this.project = grant.getProject() == null ? null : new ProjectDto(grant.getProject());
|
|
|
|
this.applicationFileName = grant.getApplication() == null ? null : grant.getApplication().getName();
|
|
|
|
|
|
|
|
this.authorIds = convert(grant.getAuthors(), user -> user.getId());
|
|
|
|
this.authorIds = convert(grant.getAuthors(), user -> user.getId());
|
|
|
|
this.authors = convert(grant.getAuthors(), UserDto::new);
|
|
|
|
this.authors = convert(grant.getAuthors(), UserDto::new);
|
|
|
|
this.leaderId = grant.getLeader().getId();
|
|
|
|
this.leaderId = grant.getLeader().getId();
|
|
|
@ -130,20 +133,20 @@ public class GrantDto {
|
|
|
|
this.comment = comment;
|
|
|
|
this.comment = comment;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ProjectDto getProject() {
|
|
|
|
public List<FileDataDto> getFiles() {
|
|
|
|
return project;
|
|
|
|
return files;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setProject(ProjectDto project) {
|
|
|
|
public void setFiles(List<FileDataDto> files) {
|
|
|
|
this.project = project;
|
|
|
|
this.files = files;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getApplicationFileName() {
|
|
|
|
public ProjectDto getProject() {
|
|
|
|
return applicationFileName;
|
|
|
|
return project;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setApplicationFileName(String applicationFileName) {
|
|
|
|
public void setProject(ProjectDto project) {
|
|
|
|
this.applicationFileName = applicationFileName;
|
|
|
|
this.project = project;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Set<Integer> getAuthorIds() {
|
|
|
|
public Set<Integer> getAuthorIds() {
|
|
|
|