generated from Sithas/conan_template
База для ручки PostUserMedicationsExecutor.h
This commit is contained in:
@@ -14,13 +14,13 @@
|
||||
namespace uad
|
||||
{
|
||||
template <class Body, class Allocator, class ResponseType>
|
||||
class GetUserMedicationsExecutor : public IExecutor<Body, Allocator, ResponseType>
|
||||
class PostUserMedicationsExecutor : public IExecutor<Body, Allocator, ResponseType>
|
||||
{
|
||||
mysqlx::Session& session_;
|
||||
const std::shared_ptr<IAuthDAO>& auth_dao_;
|
||||
const std::shared_ptr<IMedicationsDAO>& medications_dao_;
|
||||
public:
|
||||
GetUserMedicationsExecutor(
|
||||
PostUserMedicationsExecutor(
|
||||
mysqlx::Session& session,
|
||||
const std::shared_ptr<IAuthDAO>& auth_dao,
|
||||
const std::shared_ptr<IMedicationsDAO>& medications_dao
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "AuthLoginExecutor.h"
|
||||
#include "AuthLogoutExecutor.h"
|
||||
#include "GetUserMedicationsExecutor.h"
|
||||
#include "PostUserMedicationsExecutor.h"
|
||||
#include "../DAO/IUserDAO.h"
|
||||
#include "../DAO/IAuthDAO.h"
|
||||
#include "../DAO/IMedicationsDAO.h"
|
||||
@@ -28,6 +29,8 @@ class RootExecutor
|
||||
Body, Allocator, boost::beast::http::string_body>;
|
||||
using RouteUserGetMedicationsExecutor = GetUserMedicationsExecutor<
|
||||
Body, Allocator, boost::beast::http::string_body>;
|
||||
using RouteUserPostMedicationsExecutor = PostUserMedicationsExecutor<
|
||||
Body, Allocator, boost::beast::http::string_body>;
|
||||
using IRouteController = IController<Body, Allocator, boost::beast::http::string_body>;
|
||||
using RouteController = Controller<Body, Allocator, boost::beast::http::string_body>;
|
||||
using RoutesPathes = std::unordered_map<std::string, std::unique_ptr<IRouteController>>;
|
||||
@@ -85,7 +88,11 @@ public:
|
||||
{
|
||||
boost::beast::http::verb::get,
|
||||
std::make_shared<RouteUserGetMedicationsExecutor>(session_, auth_dao_, medications_dao_)
|
||||
}
|
||||
},
|
||||
{
|
||||
boost::beast::http::verb::post,
|
||||
std::make_shared<RouteUserPostMedicationsExecutor>(session_, auth_dao_, medications_dao_)
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user