replace PdbRepository with @Bean annotated method
This commit is contained in:
@@ -17,6 +17,7 @@ import org.lucares.pdbui.domain.AutocompleteResponse;
|
||||
import org.lucares.pdbui.domain.PlotRequest;
|
||||
import org.lucares.pdbui.domain.PlotResponse;
|
||||
import org.lucares.performance.db.CollectionUtils;
|
||||
import org.lucares.performance.db.PerformanceDb;
|
||||
import org.lucares.recommind.logs.DataSeries;
|
||||
import org.lucares.recommind.logs.InternalPlottingException;
|
||||
import org.lucares.recommind.logs.NoDataPointsException;
|
||||
@@ -46,9 +47,9 @@ public class PdbController implements HardcodedValues, CollectionUtils {
|
||||
private static final DateTimeFormatter DATE_FORMAT_END = DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59");
|
||||
|
||||
private final Plotter plotter;
|
||||
private final PdbRepository db;
|
||||
private final PerformanceDb db;
|
||||
|
||||
public PdbController(final PdbRepository db, final Plotter plotter) {
|
||||
public PdbController(final PerformanceDb db, final Plotter plotter) {
|
||||
this.db = db;
|
||||
this.plotter = plotter;
|
||||
}
|
||||
@@ -113,7 +114,7 @@ public class PdbController implements HardcodedValues, CollectionUtils {
|
||||
)
|
||||
@ResponseBody
|
||||
List<String> fields() {
|
||||
final List<String> fields = db.getDb().getFields();
|
||||
final List<String> fields = db.getFields();
|
||||
|
||||
return fields;
|
||||
}
|
||||
@@ -128,7 +129,7 @@ public class PdbController implements HardcodedValues, CollectionUtils {
|
||||
@RequestParam(name = "query") final String query) {
|
||||
|
||||
try {
|
||||
final List<String> fields = db.getDb().getFieldsValues(query, fieldName);
|
||||
final List<String> fields = db.getFieldsValues(query, fieldName);
|
||||
|
||||
return fields;
|
||||
} catch (final FieldNotExistsException e) {
|
||||
|
||||
Reference in New Issue
Block a user