Внесение в контроллеры Session MySQL и MySQLUserDAO

This commit is contained in:
Антон
2025-08-28 08:55:43 +03:00
parent 4e2a97edcb
commit d6d2f5a331
5 changed files with 30 additions and 8 deletions
@@ -1,20 +1,33 @@
#pragma once
#include <mysqlx/xdevapi.h>
#include <mysqlx/common/api.h>
#include "IExecutor.h"
#include "../DAO/IUserDAO.h"
namespace uad
{
template <class Body, class Allocator, class ResponseType>
class AuthRegistrationExecutor : public IExecutor<Body, Allocator, ResponseType>
{
mysqlx::Session& session_;
std::shared_ptr<IUserDAO> user_dao_;
public:
AuthRegistrationExecutor(mysqlx::Session& session,
std::shared_ptr<IUserDAO> user_dao)
: session_(session), user_dao_(user_dao)
{
}
boost::beast::http::response<ResponseType> operator ()(
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
) override
{
boost::beast::http::response<ResponseType> res{
boost::beast::http::status::ok, req.version()
};
boost::beast::http::status::ok, req.version()
};
res.body() = "{ \"detail\": \"ok\"}";
res.set(boost::beast::http::field::content_type, "application/json");