База для ручки PostUserMedicationsExecutor.h

This commit is contained in:
2026-01-08 12:12:24 +03:00
parent 8e1db614bf
commit 8657b2910b
2 changed files with 10 additions and 3 deletions
@@ -14,13 +14,13 @@
namespace uad namespace uad
{ {
template <class Body, class Allocator, class ResponseType> template <class Body, class Allocator, class ResponseType>
class GetUserMedicationsExecutor : public IExecutor<Body, Allocator, ResponseType> class PostUserMedicationsExecutor : public IExecutor<Body, Allocator, ResponseType>
{ {
mysqlx::Session& session_; mysqlx::Session& session_;
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_;
public: public:
GetUserMedicationsExecutor( PostUserMedicationsExecutor(
mysqlx::Session& session, mysqlx::Session& session,
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
+8 -1
View File
@@ -8,6 +8,7 @@
#include "AuthLoginExecutor.h" #include "AuthLoginExecutor.h"
#include "AuthLogoutExecutor.h" #include "AuthLogoutExecutor.h"
#include "GetUserMedicationsExecutor.h" #include "GetUserMedicationsExecutor.h"
#include "PostUserMedicationsExecutor.h"
#include "../DAO/IUserDAO.h" #include "../DAO/IUserDAO.h"
#include "../DAO/IAuthDAO.h" #include "../DAO/IAuthDAO.h"
#include "../DAO/IMedicationsDAO.h" #include "../DAO/IMedicationsDAO.h"
@@ -28,6 +29,8 @@ class RootExecutor
Body, Allocator, boost::beast::http::string_body>; Body, Allocator, boost::beast::http::string_body>;
using RouteUserGetMedicationsExecutor = GetUserMedicationsExecutor< using RouteUserGetMedicationsExecutor = GetUserMedicationsExecutor<
Body, Allocator, boost::beast::http::string_body>; 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 IRouteController = IController<Body, Allocator, boost::beast::http::string_body>;
using RouteController = Controller<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>>; using RoutesPathes = std::unordered_map<std::string, std::unique_ptr<IRouteController>>;
@@ -85,7 +88,11 @@ public:
{ {
boost::beast::http::verb::get, boost::beast::http::verb::get,
std::make_shared<RouteUserGetMedicationsExecutor>(session_, auth_dao_, medications_dao_) std::make_shared<RouteUserGetMedicationsExecutor>(session_, auth_dao_, medications_dao_)
} },
{
boost::beast::http::verb::post,
std::make_shared<RouteUserPostMedicationsExecutor>(session_, auth_dao_, medications_dao_)
},
} }
); );
} }