#25 -- Fix controllers
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m24s
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 1m24s
This commit is contained in:
parent
85aa8dc929
commit
7ab12d6bbe
@ -1,5 +1,6 @@
|
|||||||
package ru.ulstu.fc.rule.controller;
|
package ru.ulstu.fc.rule.controller;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@ -21,6 +22,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("rule")
|
@RequestMapping("rule")
|
||||||
|
@Hidden
|
||||||
public class FuzzyRuleController {
|
public class FuzzyRuleController {
|
||||||
private final FuzzyRuleService fuzzyRuleService;
|
private final FuzzyRuleService fuzzyRuleService;
|
||||||
private final VariableService variableService;
|
private final VariableService variableService;
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import ru.ulstu.fc.project.service.ProjectRulesService;
|
import ru.ulstu.fc.project.service.ProjectRulesService;
|
||||||
import ru.ulstu.fc.rule.model.FuzzyRule;
|
import ru.ulstu.fc.rule.model.FuzzyRule;
|
||||||
import ru.ulstu.fc.rule.model.FuzzyRuleForm;
|
import ru.ulstu.fc.rule.model.FuzzyRuleForm;
|
||||||
|
import ru.ulstu.fc.rule.service.FuzzyRuleParseService;
|
||||||
import ru.ulstu.fc.rule.service.FuzzyRuleService;
|
import ru.ulstu.fc.rule.service.FuzzyRuleService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -19,11 +20,14 @@ import java.util.List;
|
|||||||
public class FuzzyRuleRestController {
|
public class FuzzyRuleRestController {
|
||||||
private final FuzzyRuleService ruleService;
|
private final FuzzyRuleService ruleService;
|
||||||
private final ProjectRulesService projectRulesService;
|
private final ProjectRulesService projectRulesService;
|
||||||
|
private final FuzzyRuleParseService fuzzyRuleParseService;
|
||||||
|
|
||||||
public FuzzyRuleRestController(FuzzyRuleService ruleService,
|
public FuzzyRuleRestController(FuzzyRuleService ruleService,
|
||||||
ProjectRulesService projectRulesService) {
|
ProjectRulesService projectRulesService,
|
||||||
|
FuzzyRuleParseService fuzzyRuleParseService) {
|
||||||
this.ruleService = ruleService;
|
this.ruleService = ruleService;
|
||||||
this.projectRulesService = projectRulesService;
|
this.projectRulesService = projectRulesService;
|
||||||
|
this.fuzzyRuleParseService = fuzzyRuleParseService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getAll/{projectId}")
|
@GetMapping("/getAll/{projectId}")
|
||||||
@ -49,4 +53,9 @@ public class FuzzyRuleRestController {
|
|||||||
ruleService.delete(fuzzyRuleForm);
|
ruleService.delete(fuzzyRuleForm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("parse/{projectId}")
|
||||||
|
public void parseRule(@PathVariable("projectId") Integer projectId, String data) {
|
||||||
|
fuzzyRuleParseService.parseFuzzyRules(data, projectId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user