generated from Sithas/conan_template
База для ручки GetUserDiariesExecutor.h
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include "../DAO/MemoryAuthDAO.h"
|
#include "../DAO/MemoryAuthDAO.h"
|
||||||
#include "../DAO/MySQLUserDAO.h"
|
#include "../DAO/MySQLUserDAO.h"
|
||||||
#include "../DAO/MySQLMedicationsDAO.h"
|
#include "../DAO/MySQLMedicationsDAO.h"
|
||||||
|
#include "../DAO/MySQLDiariesDAO.h"
|
||||||
|
|
||||||
namespace uad
|
namespace uad
|
||||||
{
|
{
|
||||||
@@ -24,13 +25,15 @@ void HandleRequest(
|
|||||||
static std::shared_ptr<IAuthDAO> auth_dao = std::make_shared<MemoryAuthDAO>(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 std::shared_ptr<IMedicationsDAO> medications_dao = std::make_shared<MySQLMedicationsDAO>(GetMySqlSession());
|
||||||
static std::shared_ptr<IUserTreatmentSchemeDAO> user_treatment_schemes_dao = std::make_shared<MySQLUserTreatmentSchemesDAO>(GetMySqlSession());
|
static std::shared_ptr<IUserTreatmentSchemeDAO> user_treatment_schemes_dao = std::make_shared<MySQLUserTreatmentSchemesDAO>(GetMySqlSession());
|
||||||
|
static std::shared_ptr<IDiariesDAO> diaries_dao = std::make_shared<MySqlDiariesDAO>(GetMySqlSession());
|
||||||
|
|
||||||
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(),
|
GetMySqlSession(),
|
||||||
user_dao,
|
user_dao,
|
||||||
auth_dao,
|
auth_dao,
|
||||||
medications_dao,
|
medications_dao,
|
||||||
user_treatment_schemes_dao
|
user_treatment_schemes_dao,
|
||||||
|
diaries_dao
|
||||||
);
|
);
|
||||||
|
|
||||||
root_executor(doc_root, std::move(req), std::forward<Send>(send));
|
root_executor(doc_root, std::move(req), std::forward<Send>(send));
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "PostUserMedicationsExecutor.h"
|
#include "PostUserMedicationsExecutor.h"
|
||||||
#include "../DAO/IUserDAO.h"
|
#include "../DAO/IUserDAO.h"
|
||||||
#include "../DAO/IAuthDAO.h"
|
#include "../DAO/IAuthDAO.h"
|
||||||
|
#include "../DAO/IDiariesDAO.h"
|
||||||
#include "../DAO/IMedicationsDAO.h"
|
#include "../DAO/IMedicationsDAO.h"
|
||||||
#include "../DAO/IUserTreatmentSchemesDAO.h"
|
#include "../DAO/IUserTreatmentSchemesDAO.h"
|
||||||
#include "./../helpers/helpers.h"
|
#include "./../helpers/helpers.h"
|
||||||
@@ -50,6 +51,7 @@ private:
|
|||||||
const std::shared_ptr<IAuthDAO>& auth_dao_;
|
const std::shared_ptr<IAuthDAO>& auth_dao_;
|
||||||
const std::shared_ptr<IMedicationsDAO>& medications_dao_;
|
const std::shared_ptr<IMedicationsDAO>& medications_dao_;
|
||||||
const std::shared_ptr<IUserTreatmentSchemeDAO>& user_treatment_scheme_dao_;
|
const std::shared_ptr<IUserTreatmentSchemeDAO>& user_treatment_scheme_dao_;
|
||||||
|
const std::shared_ptr<IDiariesDAO>& diaries_dao_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RootExecutor(
|
RootExecutor(
|
||||||
@@ -57,11 +59,15 @@ public:
|
|||||||
const std::shared_ptr<IUserDAO>& user_dao,
|
const std::shared_ptr<IUserDAO>& user_dao,
|
||||||
const std::shared_ptr<IAuthDAO>& auth_dao,
|
const std::shared_ptr<IAuthDAO>& auth_dao,
|
||||||
const std::shared_ptr<IMedicationsDAO>& medications_dao,
|
const std::shared_ptr<IMedicationsDAO>& medications_dao,
|
||||||
const std::shared_ptr<IUserTreatmentSchemeDAO>& user_treatment_scheme_dao
|
const std::shared_ptr<IUserTreatmentSchemeDAO>& user_treatment_scheme_dao,
|
||||||
) :
|
const std::shared_ptr<IDiariesDAO>& diaries_dao
|
||||||
session_(session), user_dao_(user_dao),
|
) :
|
||||||
auth_dao_(auth_dao), medications_dao_(medications_dao),
|
session_(session),
|
||||||
user_treatment_scheme_dao_(user_treatment_scheme_dao)
|
user_dao_(user_dao),
|
||||||
|
auth_dao_(auth_dao),
|
||||||
|
medications_dao_(medications_dao),
|
||||||
|
user_treatment_scheme_dao_(user_treatment_scheme_dao),
|
||||||
|
diaries_dao_(diaries_dao)
|
||||||
{
|
{
|
||||||
routes_pathes_["/api/v1/Auth/Register"] = std::make_unique<RouteController>(
|
routes_pathes_["/api/v1/Auth/Register"] = std::make_unique<RouteController>(
|
||||||
typename RouteController::HTTPMethodsToExecutors{
|
typename RouteController::HTTPMethodsToExecutors{
|
||||||
@@ -109,7 +115,8 @@ public:
|
|||||||
typename RouteController::HTTPMethodsToExecutors{
|
typename RouteController::HTTPMethodsToExecutors{
|
||||||
{
|
{
|
||||||
boost::beast::http::verb::get,
|
boost::beast::http::verb::get,
|
||||||
std::make_shared<RouteGetUserTreatmentSchemeExecutor>(session_, auth_dao_, user_treatment_scheme_dao_)
|
std::make_shared<RouteGetUserTreatmentSchemeExecutor>(session_, auth_dao_,
|
||||||
|
user_treatment_scheme_dao_)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user