#25 -- Fix controllers
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m24s

This commit is contained in:
Anton Romanov 2025-03-14 14:22:06 +04:00
parent 85aa8dc929
commit 7ab12d6bbe
3 changed files with 12 additions and 21 deletions

View File

@ -1,5 +1,6 @@
package ru.ulstu.fc.rule.controller;
import io.swagger.v3.oas.annotations.Hidden;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.stereotype.Controller;
@ -21,6 +22,7 @@ import java.util.List;
@Controller
@RequestMapping("rule")
@Hidden
public class FuzzyRuleController {
private final FuzzyRuleService fuzzyRuleService;
private final VariableService variableService;

View File

@ -1,20 +0,0 @@
package ru.ulstu.fc.rule.controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import ru.ulstu.fc.rule.service.FuzzyRuleParseService;
@RestController("fuzzyRuleParseRest")
public class FuzzyRuleParseRestController {
private final FuzzyRuleParseService fuzzyRuleParseService;
public FuzzyRuleParseRestController(FuzzyRuleParseService fuzzyRuleParseService) {
this.fuzzyRuleParseService = fuzzyRuleParseService;
}
@PostMapping("parse/{projectId}")
public void parseRule(@PathVariable("projectId") Integer projectId, String data) {
fuzzyRuleParseService.parseFuzzyRules(data, projectId);
}
}

View File

@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
import ru.ulstu.fc.project.service.ProjectRulesService;
import ru.ulstu.fc.rule.model.FuzzyRule;
import ru.ulstu.fc.rule.model.FuzzyRuleForm;
import ru.ulstu.fc.rule.service.FuzzyRuleParseService;
import ru.ulstu.fc.rule.service.FuzzyRuleService;
import java.util.List;
@ -19,11 +20,14 @@ import java.util.List;
public class FuzzyRuleRestController {
private final FuzzyRuleService ruleService;
private final ProjectRulesService projectRulesService;
private final FuzzyRuleParseService fuzzyRuleParseService;
public FuzzyRuleRestController(FuzzyRuleService ruleService,
ProjectRulesService projectRulesService) {
ProjectRulesService projectRulesService,
FuzzyRuleParseService fuzzyRuleParseService) {
this.ruleService = ruleService;
this.projectRulesService = projectRulesService;
this.fuzzyRuleParseService = fuzzyRuleParseService;
}
@GetMapping("/getAll/{projectId}")
@ -49,4 +53,9 @@ public class FuzzyRuleRestController {
ruleService.delete(fuzzyRuleForm);
}
}
@PostMapping("parse/{projectId}")
public void parseRule(@PathVariable("projectId") Integer projectId, String data) {
fuzzyRuleParseService.parseFuzzyRules(data, projectId);
}
}