#2 -- add class for model time series
This commit is contained in:
parent
9ffb50d8c1
commit
cf46bb0bd6
@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import ru.ulstu.configurations.ApiConfiguration;
|
||||
import ru.ulstu.models.Forecast;
|
||||
import ru.ulstu.models.ForecastRequestParams;
|
||||
import ru.ulstu.models.ForecastParams;
|
||||
import ru.ulstu.models.TimeSeries;
|
||||
import ru.ulstu.services.TimeSeriesService;
|
||||
|
||||
@ -39,8 +39,8 @@ public class TimeSeriesController {
|
||||
|
||||
@PostMapping("getForecast")
|
||||
@ApiOperation("Получить прогноз временного ряда")
|
||||
public ResponseEntity<Forecast> getForecastTimeSeries(@RequestBody ForecastRequestParams forecastRequestParams) {
|
||||
return new ResponseEntity<>(timeSeriesService.getForecast(forecastRequestParams.getOriginalTimeSeries(),
|
||||
forecastRequestParams.getCountForecast()), HttpStatus.OK);
|
||||
public ResponseEntity<Forecast> getForecastTimeSeries(@RequestBody ForecastParams forecastParams) {
|
||||
return new ResponseEntity<>(timeSeriesService.getForecast(forecastParams.getOriginalTimeSeries(),
|
||||
forecastParams.getCountForecast()), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.ulstu.models;
|
||||
|
||||
public class ForecastRequestParams {
|
||||
public class ForecastParams {
|
||||
private TimeSeries originalTimeSeries;
|
||||
private int countForecast;
|
||||
|
19
src/main/java/ru/ulstu/models/ModelTimeSeries.java
Normal file
19
src/main/java/ru/ulstu/models/ModelTimeSeries.java
Normal file
@ -0,0 +1,19 @@
|
||||
package ru.ulstu.models;
|
||||
|
||||
public class ModelTimeSeries {
|
||||
private TimeSeries originalTimeSeries;
|
||||
private TimeSeries modelTimeSeries;
|
||||
|
||||
public ModelTimeSeries(TimeSeries originalTimeSeries) {
|
||||
this.originalTimeSeries = originalTimeSeries;
|
||||
this.modelTimeSeries = new TimeSeries("Model time series of '" + originalTimeSeries.getName() + "'");
|
||||
}
|
||||
|
||||
public TimeSeries getOriginalTimeSeries() {
|
||||
return originalTimeSeries;
|
||||
}
|
||||
|
||||
public TimeSeries getModelTimeSeries() {
|
||||
return modelTimeSeries;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user