30 lines
1.1 KiB
Java
30 lines
1.1 KiB
Java
package ru.ulstu.fc.rule.controller;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import ru.ulstu.fc.rule.model.InferenceData;
|
|
import ru.ulstu.fc.rule.model.OutputValue;
|
|
import ru.ulstu.fc.rule.service.FuzzyInferenceService;
|
|
|
|
import java.util.List;
|
|
|
|
@RestController
|
|
@RequestMapping("inferenceRest")
|
|
public class InferenceRestController {
|
|
private final FuzzyInferenceService fuzzyInferenceService;
|
|
|
|
public InferenceRestController(FuzzyInferenceService fuzzyInferenceService) {
|
|
this.fuzzyInferenceService = fuzzyInferenceService;
|
|
}
|
|
|
|
@RequestMapping(value = "get-inference", method = RequestMethod.POST)
|
|
public List<OutputValue> getInference(@RequestBody InferenceData inferenceData) {
|
|
return fuzzyInferenceService.getFuzzyInference(inferenceData.getRules(),
|
|
inferenceData.getValues(),
|
|
inferenceData.getInputVariables(),
|
|
inferenceData.getOutputVariable());
|
|
}
|
|
}
|