From f76976899d7a0c8ddc7f30664f9899fd0408731d Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 1 Feb 2023 22:39:40 +0400 Subject: [PATCH] #84 -- change page route and semantic --- .../java/ru/ulstu/extractor/core/Route.java | 6 ++-- .../controller/RecommendationController.java | 8 ++--- .../recommendation/model/Assessment.java | 31 +++++++++++++++++++ .../rule/service/FuzzyInferenceService.java | 2 +- ...{recommendations.html => assessments.html} | 0 5 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 src/main/java/ru/ulstu/extractor/recommendation/model/Assessment.java rename src/main/resources/templates/{recommendations.html => assessments.html} (100%) diff --git a/src/main/java/ru/ulstu/extractor/core/Route.java b/src/main/java/ru/ulstu/extractor/core/Route.java index 614bd69..be9cb53 100644 --- a/src/main/java/ru/ulstu/extractor/core/Route.java +++ b/src/main/java/ru/ulstu/extractor/core/Route.java @@ -19,7 +19,7 @@ public class Route { public static final String STATISTIC = "statistic"; public static final String LIST_RULE = "listRules"; public static final String ADD_RULE = "addRule"; - public static final String RECOMMENDATIONS = "recommendations"; + public static final String ASSESSMENTS = "assessments"; public static final String DELETE_RULE = "deleteRule"; public static String getLIST_INDEXED_REPOSITORIES() { @@ -42,7 +42,7 @@ public class Route { return STATISTIC; } - public static String getRECOMMENDATIONS() { - return RECOMMENDATIONS; + public static String getASSESSMENTS() { + return ASSESSMENTS; } } diff --git a/src/main/java/ru/ulstu/extractor/recommendation/controller/RecommendationController.java b/src/main/java/ru/ulstu/extractor/recommendation/controller/RecommendationController.java index 4c0f803..cb53532 100644 --- a/src/main/java/ru/ulstu/extractor/recommendation/controller/RecommendationController.java +++ b/src/main/java/ru/ulstu/extractor/recommendation/controller/RecommendationController.java @@ -11,7 +11,7 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.Optional; -import static ru.ulstu.extractor.core.Route.RECOMMENDATIONS; +import static ru.ulstu.extractor.core.Route.ASSESSMENTS; @Controller @ApiIgnore @@ -25,15 +25,15 @@ public class RecommendationController { this.branchService = branchService; } - @GetMapping(RECOMMENDATIONS) + @GetMapping(ASSESSMENTS) public String getRecommendations(Model model, @RequestParam Optional branchId) { model.addAttribute("branches", branchService.findAll()); if (branchId.isPresent()) { - model.addAttribute("recommendations", fuzzyInferenceService.getRecommendations(branchId.get())); + model.addAttribute("assessments", fuzzyInferenceService.getAssessments(branchId.get())); model.addAttribute("filterBranchForm", new FilterBranchForm(branchId.get())); } else { model.addAttribute("filterBranchForm", new FilterBranchForm()); } - return RECOMMENDATIONS; + return ASSESSMENTS; } } diff --git a/src/main/java/ru/ulstu/extractor/recommendation/model/Assessment.java b/src/main/java/ru/ulstu/extractor/recommendation/model/Assessment.java new file mode 100644 index 0000000..7b9c213 --- /dev/null +++ b/src/main/java/ru/ulstu/extractor/recommendation/model/Assessment.java @@ -0,0 +1,31 @@ +package ru.ulstu.extractor.recommendation.model; + +import ru.ulstu.extractor.ts.model.TimeSeriesType; + +public class Assessment { + private String consequent; + private TimeSeriesType firstAntecedent; + private String firstAntecedentTendency; + private TimeSeriesType secondAntecedent; + private String secondAntecedentTendency; + + public String getConsequent() { + return consequent; + } + + public TimeSeriesType getFirstAntecedent() { + return firstAntecedent; + } + + public String getFirstAntecedentTendency() { + return firstAntecedentTendency; + } + + public TimeSeriesType getSecondAntecedent() { + return secondAntecedent; + } + + public String getSecondAntecedentTendency() { + return secondAntecedentTendency; + } +} diff --git a/src/main/java/ru/ulstu/extractor/rule/service/FuzzyInferenceService.java b/src/main/java/ru/ulstu/extractor/rule/service/FuzzyInferenceService.java index 706f55c..ce87a89 100644 --- a/src/main/java/ru/ulstu/extractor/rule/service/FuzzyInferenceService.java +++ b/src/main/java/ru/ulstu/extractor/rule/service/FuzzyInferenceService.java @@ -109,7 +109,7 @@ public class FuzzyInferenceService { return engine; } - public String getRecommendations(Integer branchId) { + public String getAssessments(Integer branchId) { List timeSeries = timeSeriesService.getByBranch(branchId); Engine engine = getFuzzyEngine(); List antecedentValues = antecedentValueService.getList(); diff --git a/src/main/resources/templates/recommendations.html b/src/main/resources/templates/assessments.html similarity index 100% rename from src/main/resources/templates/recommendations.html rename to src/main/resources/templates/assessments.html