|
|
@ -5,7 +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.paper.model.PaperDto;
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
@ -34,7 +34,7 @@ public class GrantDto {
|
|
|
|
private boolean hasAge;
|
|
|
|
private boolean hasAge;
|
|
|
|
private boolean hasDegree;
|
|
|
|
private boolean hasDegree;
|
|
|
|
private List<Integer> paperIds = new ArrayList<>();
|
|
|
|
private List<Integer> paperIds = new ArrayList<>();
|
|
|
|
private List<PaperDto> papers = new ArrayList<>();
|
|
|
|
private List<Paper> papers = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
public GrantDto() {
|
|
|
|
public GrantDto() {
|
|
|
|
deadlines.add(new Deadline());
|
|
|
|
deadlines.add(new Deadline());
|
|
|
@ -54,7 +54,7 @@ public class GrantDto {
|
|
|
|
@JsonProperty("hasAge") boolean hasAge,
|
|
|
|
@JsonProperty("hasAge") boolean hasAge,
|
|
|
|
@JsonProperty("hasDegree") boolean hasDegree,
|
|
|
|
@JsonProperty("hasDegree") boolean hasDegree,
|
|
|
|
@JsonProperty("paperIds") List<Integer> paperIds,
|
|
|
|
@JsonProperty("paperIds") List<Integer> paperIds,
|
|
|
|
@JsonProperty("papers") List<PaperDto> papers) {
|
|
|
|
@JsonProperty("papers") List<Paper> papers) {
|
|
|
|
this.id = id;
|
|
|
|
this.id = id;
|
|
|
|
this.title = title;
|
|
|
|
this.title = title;
|
|
|
|
this.status = status;
|
|
|
|
this.status = status;
|
|
|
@ -86,7 +86,7 @@ public class GrantDto {
|
|
|
|
this.hasAge = false;
|
|
|
|
this.hasAge = false;
|
|
|
|
this.hasDegree = false;
|
|
|
|
this.hasDegree = false;
|
|
|
|
this.paperIds = convert(grant.getPapers(), paper -> paper.getId());
|
|
|
|
this.paperIds = convert(grant.getPapers(), paper -> paper.getId());
|
|
|
|
this.papers = convert(grant.getPapers(), PaperDto::new);
|
|
|
|
this.papers = grant.getPapers();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Integer getId() {
|
|
|
|
public Integer getId() {
|
|
|
@ -208,11 +208,11 @@ public class GrantDto {
|
|
|
|
this.paperIds = paperIds;
|
|
|
|
this.paperIds = paperIds;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<PaperDto> getPapers() {
|
|
|
|
public List<Paper> getPapers() {
|
|
|
|
return papers;
|
|
|
|
return papers;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setPapers(List<PaperDto> papers) {
|
|
|
|
public void setPapers(List<Paper> papers) {
|
|
|
|
this.papers = papers;
|
|
|
|
this.papers = papers;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|