This commit is contained in:
Anton Romanov 2019-03-04 10:28:46 +04:00
parent e2c12d9fb2
commit 4f47b1beb6
4 changed files with 18 additions and 17 deletions

View File

@ -107,11 +107,11 @@ public class GrantService {
}
@Transactional
public Grant create(String title, Project project_id, Date deadlineDate) {
public Grant create(String title, Project projectId, Date deadlineDate) {
Grant grant = new Grant();
grant.setTitle(title);
grant.setComment("Комментарий к гранту 1");
grant.setProject(project_id);
grant.setProject(projectId);
grant.setStatus(APPLICATION);
grant.getDeadlines().add(new Deadline(deadlineDate, "первый дедлайн"));
grant = grantRepository.save(grant);

View File

@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;
import ru.ulstu.deadline.model.DeadlineDto;
import ru.ulstu.project.model.Project;
import java.util.ArrayList;
import java.util.List;
@ -19,7 +18,8 @@ public class ProjectDto {
private List<DeadlineDto> deadlines = new ArrayList<>();
public ProjectDto() {}
public ProjectDto() {
}
public ProjectDto(String title) {
this.title = title;
@ -45,22 +45,23 @@ public class ProjectDto {
return id;
}
public String getTitle() {
return title;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public void setDeadlines(List<DeadlineDto> deadlines) {
this.deadlines = deadlines;
}
public List<DeadlineDto> getDeadlines() {
return deadlines;
}
public void setDeadlines(List<DeadlineDto> deadlines) {
this.deadlines = deadlines;
}
}