Внесение в контроллеры Session MySQL и MySQLUserDAO

This commit is contained in:
Антон
2025-08-28 08:55:43 +03:00
parent 4e2a97edcb
commit d6d2f5a331
5 changed files with 30 additions and 8 deletions
+6 -4
View File
@@ -1,12 +1,12 @@
#pragma once
#include <memory>
#include <boost/beast.hpp>
#include "Controller.h"
#include "../db/mysql_connector.h"
#include "../DAO/IUserDAO.h"
#include "AuthRegistrationExecutor.h"
#include "RootExecutor.h"
#include "../DAO/MySQLUserDAO.h"
namespace uad
{
@@ -16,7 +16,9 @@ void HandleRequest(
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req,
Send&& send)
{
static RootExecutor<Body, Allocator, boost::beast::http::string_body, Send> root_executor;
static RootExecutor<Body, Allocator, boost::beast::http::string_body, Send> root_executor(
GetMySqlSession(), std::make_shared<MySQLUserDAO>(GetMySqlSession())
);
root_executor(doc_root, std::move(req), std::forward<Send>(send));
}