generated from Sithas/conan_template
Добавление ДАО для использования в новом маршруте
This commit is contained in:
@@ -84,7 +84,7 @@ public:
|
||||
typename RouteController::HTTPMethodsToExecutors{
|
||||
{
|
||||
boost::beast::http::verb::get,
|
||||
std::make_shared<RouteUserGetMedicationsExecutor>()
|
||||
std::make_shared<RouteUserGetMedicationsExecutor>(session_, auth_dao_, medications_dao_)
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#include <mysqlx/xdevapi.h>
|
||||
|
||||
#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 Body, class Allocator, class ResponseType>
|
||||
class UserGetMedicationsExecutor : public IExecutor<Body, Allocator, ResponseType>
|
||||
{
|
||||
mysqlx::Session& session_;
|
||||
const std::shared_ptr<IAuthDAO>& auth_dao_;
|
||||
const std::shared_ptr<IMedicationsDAO>& medications_dao_;
|
||||
public:
|
||||
UserGetMedicationsExecutor() = default;
|
||||
UserGetMedicationsExecutor(
|
||||
mysqlx::Session& session,
|
||||
const std::shared_ptr<IAuthDAO>& auth_dao,
|
||||
const std::shared_ptr<IMedicationsDAO>& medications_dao
|
||||
): session_(session), auth_dao_(auth_dao), medications_dao_(medications_dao)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
boost::beast::http::response<ResponseType> operator ()(
|
||||
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
|
||||
|
||||
Reference in New Issue
Block a user