From ca3e87a8c54b7d13ac9bb78b067a6238520bb3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 13:50:22 +0300 Subject: [PATCH 1/9] #96 edit project blank page --- .../project/controller/ProjectController.java | 10 +++++ .../java/ru/ulstu/project/model/Project.java | 5 +-- .../ru/ulstu/project/model/ProjectDto.java | 1 - .../ulstu/project/service/ProjectService.java | 5 +++ .../fragments/projectNavigationFragment.html | 4 +- .../resources/templates/projects/project.html | 45 +++++++++++++++++++ 6 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/templates/projects/project.html diff --git a/src/main/java/ru/ulstu/project/controller/ProjectController.java b/src/main/java/ru/ulstu/project/controller/ProjectController.java index 5b5eb4a..b71fc1d 100644 --- a/src/main/java/ru/ulstu/project/controller/ProjectController.java +++ b/src/main/java/ru/ulstu/project/controller/ProjectController.java @@ -5,6 +5,7 @@ import org.springframework.ui.ModelMap; import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.*; import ru.ulstu.deadline.model.Deadline; +import ru.ulstu.grant.model.GrantDto; import ru.ulstu.project.model.Project; import ru.ulstu.project.model.ProjectDto; import ru.ulstu.project.service.ProjectService; @@ -36,4 +37,13 @@ public class ProjectController { public void getProjects(ModelMap modelMap) { modelMap.put("projects", projectService.findAllDto()); } + + @GetMapping("/project") + public void getProject(ModelMap modelMap, @RequestParam(value = "id") Integer id) { + if (id != null && id > 0) { + modelMap.put("projectDto", projectService.findOneDto(id)); + } else { + modelMap.put("projectDto", new ProjectDto()); + } + } } diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index 06722a1..07a8108 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -4,10 +4,7 @@ import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.deadline.model.Deadline; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; +import javax.persistence.*; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ru/ulstu/project/model/ProjectDto.java b/src/main/java/ru/ulstu/project/model/ProjectDto.java index db7fc75..8549994 100644 --- a/src/main/java/ru/ulstu/project/model/ProjectDto.java +++ b/src/main/java/ru/ulstu/project/model/ProjectDto.java @@ -13,7 +13,6 @@ public class ProjectDto { @NotEmpty private String title; - private List deadlines = new ArrayList<>(); public ProjectDto() { diff --git a/src/main/java/ru/ulstu/project/service/ProjectService.java b/src/main/java/ru/ulstu/project/service/ProjectService.java index 78a9d3c..bdf5f33 100644 --- a/src/main/java/ru/ulstu/project/service/ProjectService.java +++ b/src/main/java/ru/ulstu/project/service/ProjectService.java @@ -8,6 +8,7 @@ import ru.ulstu.project.model.Project; import ru.ulstu.project.model.ProjectDto; import ru.ulstu.project.repository.ProjectRepository; +import java.util.Arrays; import java.util.List; import static org.springframework.util.ObjectUtils.isEmpty; @@ -36,6 +37,10 @@ public class ProjectService { return projects; } + public ProjectDto findOneDto(Integer id) { + return new ProjectDto(projectRepository.findOne(id)); + } + @Transactional public Project create(ProjectDto projectDto) { Project newProject = copyFromDto(new Project(), projectDto); diff --git a/src/main/resources/templates/projects/fragments/projectNavigationFragment.html b/src/main/resources/templates/projects/fragments/projectNavigationFragment.html index c26d8b8..75dfff6 100644 --- a/src/main/resources/templates/projects/fragments/projectNavigationFragment.html +++ b/src/main/resources/templates/projects/fragments/projectNavigationFragment.html @@ -16,8 +16,8 @@ diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html new file mode 100644 index 0000000..c8c88d4 --- /dev/null +++ b/src/main/resources/templates/projects/project.html @@ -0,0 +1,45 @@ + + + + + + + +
+ +
+
+
+
+

Редактирование проекта

+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ + From a89d93a9b08f9ef7e48280892534ef61968c96be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:01:45 +0300 Subject: [PATCH 2/9] #96 project line fragment added --- .../fragments/projectLineFragment.html | 18 ++++++++++++++++++ .../resources/templates/projects/project.html | 1 + .../resources/templates/projects/projects.html | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/templates/projects/fragments/projectLineFragment.html diff --git a/src/main/resources/templates/projects/fragments/projectLineFragment.html b/src/main/resources/templates/projects/fragments/projectLineFragment.html new file mode 100644 index 0000000..ccf29bf --- /dev/null +++ b/src/main/resources/templates/projects/fragments/projectLineFragment.html @@ -0,0 +1,18 @@ + + + + + + +
+
+ + + + + + +
+
+ + \ No newline at end of file diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index c8c88d4..a198cd4 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -22,6 +22,7 @@
+
diff --git a/src/main/resources/templates/projects/projects.html b/src/main/resources/templates/projects/projects.html index 0336770..fd19383 100644 --- a/src/main/resources/templates/projects/projects.html +++ b/src/main/resources/templates/projects/projects.html @@ -18,8 +18,8 @@
- -
+ +
From 4ea40931ebb1945d7a7f97ec98d163bcb0f81fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:06:38 +0300 Subject: [PATCH 3/9] #96 project status fragment added --- .../fragments/projectLineFragment.html | 2 +- .../fragments/projectStatusFragment.html | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/templates/projects/fragments/projectStatusFragment.html diff --git a/src/main/resources/templates/projects/fragments/projectLineFragment.html b/src/main/resources/templates/projects/fragments/projectLineFragment.html index ccf29bf..ad517f1 100644 --- a/src/main/resources/templates/projects/fragments/projectLineFragment.html +++ b/src/main/resources/templates/projects/fragments/projectLineFragment.html @@ -6,7 +6,7 @@
- + diff --git a/src/main/resources/templates/projects/fragments/projectStatusFragment.html b/src/main/resources/templates/projects/fragments/projectStatusFragment.html new file mode 100644 index 0000000..e5da374 --- /dev/null +++ b/src/main/resources/templates/projects/fragments/projectStatusFragment.html @@ -0,0 +1,31 @@ + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + \ No newline at end of file From f079e34a57ff205705476763acefed6e9b54b01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:18:35 +0300 Subject: [PATCH 4/9] #96 project title added --- src/main/resources/templates/projects/project.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index a198cd4..b46c328 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -22,6 +22,18 @@
+
+ +
+ + +

Incorrect title

+

+
+
From 255692d6ea7d125e526266d706474adbf943aef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:38:07 +0300 Subject: [PATCH 5/9] #96 project status added --- .../project/controller/ProjectController.java | 5 ++++ .../java/ru/ulstu/project/model/Project.java | 29 +++++++++++++++++++ .../ru/ulstu/project/model/ProjectDto.java | 12 ++++++++ .../ulstu/project/service/ProjectService.java | 4 +++ .../resources/templates/projects/project.html | 9 ++++++ 5 files changed, 59 insertions(+) diff --git a/src/main/java/ru/ulstu/project/controller/ProjectController.java b/src/main/java/ru/ulstu/project/controller/ProjectController.java index b71fc1d..88d2612 100644 --- a/src/main/java/ru/ulstu/project/controller/ProjectController.java +++ b/src/main/java/ru/ulstu/project/controller/ProjectController.java @@ -46,4 +46,9 @@ public class ProjectController { modelMap.put("projectDto", new ProjectDto()); } } + + @ModelAttribute("allStatuses") + public List getProjectStatuses() { + return projectService.getProjectStatuses(); + } } diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index 07a8108..de2db7a 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -10,10 +10,31 @@ import java.util.List; @Entity public class Project extends BaseEntity { + public enum ProjectStatus { + APPLICATION("Заявка"), + ON_COMPETITION("Отправлен на конкурс"), + SUCCESSFUL_PASSAGE("Успешное прохождение"), + IN_WORK("В работе"), + COMPLETED("Завершен"), + FAILED("Провалены сроки"); + + private String statusName; + + ProjectStatus(String statusName) { + this.statusName = statusName; + } + + public String getStatusName() { + return statusName; + } + } @NotBlank private String title; + @Enumerated(value = EnumType.STRING) + private ProjectStatus status = ProjectStatus.APPLICATION; + @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name = "project_id") private List deadlines = new ArrayList<>(); @@ -26,6 +47,14 @@ public class Project extends BaseEntity { this.title = title; } + public ProjectStatus getStatus() { + return status; + } + + public void setStatus(ProjectStatus status) { + this.status = status; + } + public List getDeadlines() { return deadlines; } diff --git a/src/main/java/ru/ulstu/project/model/ProjectDto.java b/src/main/java/ru/ulstu/project/model/ProjectDto.java index 8549994..adb8979 100644 --- a/src/main/java/ru/ulstu/project/model/ProjectDto.java +++ b/src/main/java/ru/ulstu/project/model/ProjectDto.java @@ -13,6 +13,7 @@ public class ProjectDto { @NotEmpty private String title; + private Project.ProjectStatus status; private List deadlines = new ArrayList<>(); public ProjectDto() { @@ -25,9 +26,11 @@ public class ProjectDto { @JsonCreator public ProjectDto(@JsonProperty("id") Integer id, @JsonProperty("title") String title, + @JsonProperty("status") Project.ProjectStatus status, @JsonProperty("deadlines") List deadlines) { this.id = id; this.title = title; + this.status = status; this.deadlines = deadlines; } @@ -35,6 +38,7 @@ public class ProjectDto { public ProjectDto(Project project) { this.id = project.getId(); this.title = project.getTitle(); + this.status = project.getStatus(); this.deadlines = project.getDeadlines(); } @@ -54,6 +58,14 @@ public class ProjectDto { this.title = title; } + public Project.ProjectStatus getStatus() { + return status; + } + + public void setStatus(Project.ProjectStatus status) { + this.status = status; + } + public List getDeadlines() { return deadlines; } diff --git a/src/main/java/ru/ulstu/project/service/ProjectService.java b/src/main/java/ru/ulstu/project/service/ProjectService.java index bdf5f33..99d8919 100644 --- a/src/main/java/ru/ulstu/project/service/ProjectService.java +++ b/src/main/java/ru/ulstu/project/service/ProjectService.java @@ -41,6 +41,10 @@ public class ProjectService { return new ProjectDto(projectRepository.findOne(id)); } + public List getProjectStatuses() { + return Arrays.asList(Project.ProjectStatus.values()); + } + @Transactional public Project create(ProjectDto projectDto) { Project newProject = copyFromDto(new Project(), projectDto); diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index b46c328..cce6df8 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -33,6 +33,15 @@ class="alert alert-danger">Incorrect title

+ +
+ + +
From e85c814f706449cbf1e812bb155e1f6877c2a542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Wed, 17 Apr 2019 14:46:42 +0300 Subject: [PATCH 6/9] #96 project comment added --- src/main/java/ru/ulstu/project/model/Project.java | 12 ++++++++++++ src/main/java/ru/ulstu/project/model/ProjectDto.java | 12 ++++++++++++ src/main/resources/templates/projects/project.html | 6 ++++++ 3 files changed, 30 insertions(+) diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index de2db7a..4432224 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -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 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 getDeadlines() { return deadlines; } diff --git a/src/main/java/ru/ulstu/project/model/ProjectDto.java b/src/main/java/ru/ulstu/project/model/ProjectDto.java index adb8979..237be0f 100644 --- a/src/main/java/ru/ulstu/project/model/ProjectDto.java +++ b/src/main/java/ru/ulstu/project/model/ProjectDto.java @@ -14,6 +14,7 @@ public class ProjectDto { @NotEmpty private String title; private Project.ProjectStatus status; + private String comment; private List 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 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 getDeadlines() { return deadlines; } diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index cce6df8..8374df1 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -42,6 +42,12 @@
+ +
+ + +
From b7226870509aae5dedc8da7bf984008041af5997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Thu, 18 Apr 2019 10:32:43 +0300 Subject: [PATCH 7/9] #96 edit project page --- .../java/ru/ulstu/project/model/Project.java | 34 +++++++-- .../ru/ulstu/project/model/ProjectDto.java | 41 ++++++++-- .../fragments/projectLineFragment.html | 2 +- .../resources/templates/projects/project.html | 74 ++++++++++++++++++- 4 files changed, 134 insertions(+), 17 deletions(-) diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index 4432224..0db475d 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -3,6 +3,7 @@ package ru.ulstu.project.model; import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.deadline.model.Deadline; +import ru.ulstu.grant.model.Grant; import javax.persistence.*; import javax.validation.constraints.NotNull; @@ -37,12 +38,19 @@ public class Project extends BaseEntity { private ProjectStatus status = ProjectStatus.APPLICATION; @NotNull - private String comment; + private String description; @OneToMany(cascade = CascadeType.ALL) @JoinColumn(name = "project_id") private List deadlines = new ArrayList<>(); + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "grant_id") + private Grant grant; + + @NotNull + private String repository; + public String getTitle() { return title; } @@ -59,12 +67,28 @@ public class Project extends BaseEntity { 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 Grant getGrant() { + return grant; + } + + public void setGrant(Grant grant) { + this.grant = grant; + } + + public String getRepository() { + return repository; + } + + public void setRepository(String repository) { + this.repository = repository; } public List getDeadlines() { diff --git a/src/main/java/ru/ulstu/project/model/ProjectDto.java b/src/main/java/ru/ulstu/project/model/ProjectDto.java index 237be0f..6c83d59 100644 --- a/src/main/java/ru/ulstu/project/model/ProjectDto.java +++ b/src/main/java/ru/ulstu/project/model/ProjectDto.java @@ -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 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 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 getDeadlines() { diff --git a/src/main/resources/templates/projects/fragments/projectLineFragment.html b/src/main/resources/templates/projects/fragments/projectLineFragment.html index ad517f1..3605273 100644 --- a/src/main/resources/templates/projects/fragments/projectLineFragment.html +++ b/src/main/resources/templates/projects/fragments/projectLineFragment.html @@ -9,7 +9,7 @@
- +
diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index 8374df1..3d356a7 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -44,9 +44,59 @@
- - + + +
+ +
+ +
+ +
+ +
+ +
+ + +

Incorrect repository link

+

+
+ +
+ +
+ +
+ +
+
+ +
+
+ + +
+
+

Incorrect title

+
+
+ +
+ +
+ +
+ +
@@ -68,6 +118,24 @@
+ +
From ced3b0a978ed2679258ea7bf9ffa40ea67a3118c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Thu, 18 Apr 2019 12:10:27 +0300 Subject: [PATCH 8/9] #96 database edited --- .../db/changelog-20190418_000000-schema.xml | 22 +++++++++++++++++++ src/main/resources/db/changelog-master.xml | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/main/resources/db/changelog-20190418_000000-schema.xml diff --git a/src/main/resources/db/changelog-20190418_000000-schema.xml b/src/main/resources/db/changelog-20190418_000000-schema.xml new file mode 100644 index 0000000..31cf21c --- /dev/null +++ b/src/main/resources/db/changelog-20190418_000000-schema.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/db/changelog-master.xml b/src/main/resources/db/changelog-master.xml index 67d3c40..22d3cbd 100644 --- a/src/main/resources/db/changelog-master.xml +++ b/src/main/resources/db/changelog-master.xml @@ -24,5 +24,6 @@ + \ No newline at end of file From d015b02862db14cdf9c56d66c4cef79678403e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Thu, 18 Apr 2019 13:26:11 +0300 Subject: [PATCH 9/9] #96 removed wildcards from imports --- .../ulstu/project/controller/ProjectController.java | 13 ++++--------- src/main/java/ru/ulstu/project/model/Project.java | 8 +++++++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/ru/ulstu/project/controller/ProjectController.java b/src/main/java/ru/ulstu/project/controller/ProjectController.java index 88d2612..3244ccb 100644 --- a/src/main/java/ru/ulstu/project/controller/ProjectController.java +++ b/src/main/java/ru/ulstu/project/controller/ProjectController.java @@ -2,21 +2,16 @@ package ru.ulstu.project.controller; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; -import ru.ulstu.deadline.model.Deadline; -import ru.ulstu.grant.model.GrantDto; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import ru.ulstu.project.model.Project; import ru.ulstu.project.model.ProjectDto; import ru.ulstu.project.service.ProjectService; import springfox.documentation.annotations.ApiIgnore; -import javax.validation.Valid; -import java.io.IOException; import java.util.List; -import java.util.stream.Collectors; - -import static liquibase.util.StringUtils.isEmpty; @Controller() @RequestMapping(value = "/projects") diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index 0db475d..2e0e86c 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -5,7 +5,13 @@ import ru.ulstu.core.model.BaseEntity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.grant.model.Grant; -import javax.persistence.*; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List;