Добавление ДАО для использования в новом маршруте

This commit is contained in:
2026-01-05 15:29:47 +03:00
parent 49a2913884
commit 8df55238be
7 changed files with 91 additions and 7 deletions
+5 -1
View File
@@ -4,10 +4,12 @@
#include "../db/mysql_connector.h"
#include "../DAO/IUserDAO.h"
#include "../DAO/IMedicationsDAO.h"
#include "AuthRegistrationExecutor.h"
#include "RootExecutor.h"
#include "../DAO/MemoryAuthDAO.h"
#include "../DAO/MySQLUserDAO.h"
#include "../DAO/MySQLMedicationsDAO.h"
namespace uad
{
@@ -19,11 +21,13 @@ void HandleRequest(
{
static std::shared_ptr<IUserDAO> user_dao = std::make_shared<MySQLUserDAO>(GetMySqlSession());
static std::shared_ptr<IAuthDAO> auth_dao = std::make_shared<MemoryAuthDAO>(GetMySqlSession());
static std::shared_ptr<IMedicationsDAO> medications_dao = std::make_shared<MySQLMedicationsDAO>(GetMySqlSession());
static RootExecutor<Body, Allocator, boost::beast::http::string_body, Send> root_executor(
GetMySqlSession(),
user_dao,
auth_dao
auth_dao,
medications_dao
);
root_executor(doc_root, std::move(req), std::forward<Send>(send));