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

This commit is contained in:
2026-01-11 16:25:13 +03:00
parent a81952e40e
commit b13f145b4f
4 changed files with 83 additions and 5 deletions
+16 -4
View File
@@ -8,6 +8,7 @@
#include "AuthLoginExecutor.h"
#include "AuthLogoutExecutor.h"
#include "GetUserMedicationsExecutor.h"
#include "GetUserTreatmentSchemeExecutor.h"
#include "PostUserMedicationsExecutor.h"
#include "../DAO/IUserDAO.h"
#include "../DAO/IAuthDAO.h"
@@ -28,9 +29,11 @@ class RootExecutor
Body, Allocator, boost::beast::http::string_body>;
using RouteAuthLogoutExecutor = AuthLogoutExecutor<
Body, Allocator, boost::beast::http::string_body>;
using RouteUserGetMedicationsExecutor = GetUserMedicationsExecutor<
using RouteGetUserMedicationsExecutor = GetUserMedicationsExecutor<
Body, Allocator, boost::beast::http::string_body>;
using RouteUserPostMedicationsExecutor = PostUserMedicationsExecutor<
using RoutePostUserMedicationsExecutor = PostUserMedicationsExecutor<
Body, Allocator, boost::beast::http::string_body>;
using RouteGetUserTreatmentSchemeExecutor = GetUserTreatmentSchemeExecutor<
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>;
@@ -93,11 +96,20 @@ public:
typename RouteController::HTTPMethodsToExecutors{
{
boost::beast::http::verb::get,
std::make_shared<RouteUserGetMedicationsExecutor>(session_, auth_dao_, medications_dao_)
std::make_shared<RouteGetUserMedicationsExecutor>(session_, auth_dao_, medications_dao_)
},
{
boost::beast::http::verb::post,
std::make_shared<RouteUserPostMedicationsExecutor>(session_, auth_dao_, medications_dao_)
std::make_shared<RoutePostUserMedicationsExecutor>(session_, auth_dao_, medications_dao_)
},
}
);
routes_pathes_["api/v1/UserTreatmentSchemes"] = std::make_unique<RouteController>(
typename RouteController::HTTPMethodsToExecutors{
{
boost::beast::http::verb::get,
std::make_shared<RouteGetUserTreatmentSchemeExecutor>(session_, auth_dao_, user_treatment_scheme_dao_)
},
}
);