diff --git a/src/main/java/ru/ulstu/admin/model/IndicatorForm.java b/src/main/java/ru/ulstu/admin/model/IndicatorForm.java index 2ef8d45..adeb8d0 100644 --- a/src/main/java/ru/ulstu/admin/model/IndicatorForm.java +++ b/src/main/java/ru/ulstu/admin/model/IndicatorForm.java @@ -7,6 +7,8 @@ public class IndicatorForm { private int max; + private String proofDocuments; + public String getName() { return name; } @@ -30,4 +32,12 @@ public class IndicatorForm { public void setMax(int max) { this.max = max; } + + public String getProofDocuments() { + return proofDocuments; + } + + public void setProofDocuments(String proofDocuments) { + this.proofDocuments = proofDocuments; + } } diff --git a/src/main/java/ru/ulstu/admin/service/AdminService.java b/src/main/java/ru/ulstu/admin/service/AdminService.java index 6151795..07bf447 100644 --- a/src/main/java/ru/ulstu/admin/service/AdminService.java +++ b/src/main/java/ru/ulstu/admin/service/AdminService.java @@ -25,6 +25,7 @@ public class AdminService { : indicatorService.getIndicatorById(indicatorForm.getId()); indicator.setName(indicatorForm.getName()); indicator.setMax(indicatorForm.getMax()); + indicator.setProofDocuments(indicatorForm.getProofDocuments()); indicatorService.save(indicator); } diff --git a/src/main/java/ru/ulstu/indicator/model/Indicator.java b/src/main/java/ru/ulstu/indicator/model/Indicator.java index 6a8beca..a60e21f 100644 --- a/src/main/java/ru/ulstu/indicator/model/Indicator.java +++ b/src/main/java/ru/ulstu/indicator/model/Indicator.java @@ -1,6 +1,7 @@ package ru.ulstu.indicator.model; import jakarta.persistence.Entity; +import jakarta.persistence.Lob; import jakarta.validation.constraints.Max; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.NotBlank; @@ -17,12 +18,17 @@ public class Indicator extends BaseEntity { @Max(30) private int max; + @NotBlank + @Lob + private String proofDocuments; + public Indicator() { } public Indicator(IndicatorForm indicatorForm) { this.name = indicatorForm.getName(); this.max = indicatorForm.getMax(); + this.proofDocuments = indicatorForm.getProofDocuments(); } public String getName() { @@ -40,4 +46,12 @@ public class Indicator extends BaseEntity { public void setMax(int max) { this.max = max; } + + public String getProofDocuments() { + return proofDocuments; + } + + public void setProofDocuments(String proofDocuments) { + this.proofDocuments = proofDocuments; + } } diff --git a/src/main/resources/templates/editIndicator.html b/src/main/resources/templates/editIndicator.html index 6fb8fbb..6d9146c 100644 --- a/src/main/resources/templates/editIndicator.html +++ b/src/main/resources/templates/editIndicator.html @@ -11,15 +11,42 @@
- Не может быть пустым
++ Не может быть пустым +
+ Не может быть пустым +