Обновление контроллеров и хранилища
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include <controllers/anomaly_logs/get.h>
|
||||
#include <data_models/anomaly_logs.h>
|
||||
#include <storage/transaction.h>
|
||||
#include <storage/storage.h>
|
||||
#include <utils/utils.h>
|
||||
|
||||
#include "details/fields.h"
|
||||
@@ -12,13 +12,14 @@ json Get::operator()(const json& parameters) const {
|
||||
utils::CheckForRequiredFields(parameters, { fields::last_id });
|
||||
|
||||
// Создаём транзакцию
|
||||
auto transaction = storage::Transaction::Create();
|
||||
auto transaction = storage::Storage::Get().CreateTransaction();
|
||||
|
||||
// Создаём модель
|
||||
data_models::AnomalyLogsModel anomaly_logs_model(transaction);
|
||||
|
||||
// Запрашиваем логи
|
||||
auto anomaly_logs = anomaly_logs_model.GetAll(parameters[fields::last_id]);
|
||||
auto last_id = std::stoull(parameters[fields::last_id].get<std::string>());
|
||||
auto anomaly_logs = anomaly_logs_model.GetAll(last_id);
|
||||
|
||||
// Формируем ответ
|
||||
json result = json::array();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <controllers/anomaly_logs/update_cluster_id.h>
|
||||
#include <data_models/anomaly_logs.h>
|
||||
#include <storage/transaction.h>
|
||||
#include <storage/storage.h>
|
||||
#include <utils/utils.h>
|
||||
|
||||
#include "details/fields.h"
|
||||
@@ -12,7 +12,7 @@ json UpdateClusterId::operator()(const json& parameters) const {
|
||||
utils::CheckForRequiredFields(parameters, { fields::id, fields::cluster_id });
|
||||
|
||||
// Создаём транзакцию
|
||||
auto transaction = storage::Transaction::Create();
|
||||
auto transaction = storage::Storage::Get().CreateTransaction();
|
||||
|
||||
// Создаём модель
|
||||
data_models::AnomalyLogsModel anomaly_logs_model(transaction);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <controllers/logs_clusters/create.h>
|
||||
#include <data_models/logs_clusters.h>
|
||||
#include <storage/transaction.h>
|
||||
#include <storage/storage.h>
|
||||
#include <utils/utils.h>
|
||||
|
||||
#include "details/fields.h"
|
||||
@@ -12,7 +12,7 @@ json Create::operator()(const json& parameters) const {
|
||||
utils::CheckForRequiredFields(parameters, { fields::id, fields::name, fields::description, fields::recommendation });
|
||||
|
||||
// Создаём транзакцию
|
||||
auto transaction = storage::Transaction::Create();
|
||||
auto transaction = storage::Storage::Get().CreateTransaction();
|
||||
|
||||
// Создаём модель
|
||||
data_models::LogsClustersModel logs_clusters_model(transaction);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <controllers/logs_clusters/get.h>
|
||||
#include <data_models/logs_clusters.h>
|
||||
#include <storage/transaction.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
#include "details/fields.h"
|
||||
|
||||
@@ -8,7 +8,7 @@ using namespace controllers::logs_clusters;
|
||||
|
||||
json Get::operator()(const json& parameters) const {
|
||||
// Создаём транзакцию
|
||||
auto transaction = storage::Transaction::Create();
|
||||
auto transaction = storage::Storage::Get().CreateTransaction();
|
||||
|
||||
// Создаём модель
|
||||
data_models::LogsClustersModel logs_clusters_model(transaction);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <controllers/statistics/get.h>
|
||||
#include <data_models/statistics.h>
|
||||
#include <storage/transaction.h>
|
||||
#include <storage/storage.h>
|
||||
|
||||
using namespace controllers::statistics;
|
||||
|
||||
json Get::operator()(const json& parameters) const {
|
||||
// Создаём транзакцию
|
||||
auto transaction = storage::Transaction::Create();
|
||||
auto transaction = storage::Storage::Get().CreateTransaction();
|
||||
|
||||
// Создаём модель
|
||||
data_models::StatisticsModel statistics_model(transaction);
|
||||
|
||||
Reference in New Issue
Block a user