Внесение в контроллеры 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 -2
View File
@@ -2,6 +2,7 @@
#include "IController.h"
#include "Controller.h"
#include "AuthRegistrationExecutor.h"
#include "../DAO/IUserDAO.h"
#include "./../helpers/helpers.h"
namespace uad
@@ -22,13 +23,16 @@ class RootExecutor
private:
RoutesPathes routes_pathes_;
mysqlx::Session& session_;
std::shared_ptr<IUserDAO> user_dao_;
public:
RootExecutor()
RootExecutor(mysqlx::Session& session, std::shared_ptr<IUserDAO> user_dao)
: session_(session), user_dao_(user_dao)
{
routes_pathes_["/api/v1/Auth/Register"] = std::make_unique<RouteController>(
typename RouteController::HTTPMethodsToExecutors{
{boost::beast::http::verb::get, std::make_shared<RouteAuthRegistrationExecutor>()}
{boost::beast::http::verb::post, std::make_shared<RouteAuthRegistrationExecutor>(session_, user_dao_)}
}
);
}