diff --git a/src/endpoints_handlers/RootExecutor.h b/src/endpoints_handlers/RootExecutor.h index ca3659f..3d0e2fb 100644 --- a/src/endpoints_handlers/RootExecutor.h +++ b/src/endpoints_handlers/RootExecutor.h @@ -84,7 +84,7 @@ public: typename RouteController::HTTPMethodsToExecutors{ { boost::beast::http::verb::get, - std::make_shared() + std::make_shared(session_, auth_dao_, medications_dao_) } } ); diff --git a/src/endpoints_handlers/UserGetMedicationsExecutor.h b/src/endpoints_handlers/UserGetMedicationsExecutor.h index ef3dea3..90c3398 100644 --- a/src/endpoints_handlers/UserGetMedicationsExecutor.h +++ b/src/endpoints_handlers/UserGetMedicationsExecutor.h @@ -6,7 +6,8 @@ #include #include "IExecutor.h" -#include "../DAO/IUserDAO.h" +#include "../DAO/IAuthDAO.h" +#include "../DAO/IMedicationsDAO.h" #include "../exceptions/session_exception.h" namespace uad @@ -14,8 +15,18 @@ namespace uad template class UserGetMedicationsExecutor : public IExecutor { + mysqlx::Session& session_; + const std::shared_ptr& auth_dao_; + const std::shared_ptr& medications_dao_; public: - UserGetMedicationsExecutor() = default; + UserGetMedicationsExecutor( + mysqlx::Session& session, + const std::shared_ptr& auth_dao, + const std::shared_ptr& medications_dao + ): session_(session), auth_dao_(auth_dao), medications_dao_(medications_dao) + { + + } boost::beast::http::response operator ()( boost::beast::http::request>&& req