Files
UpAndDown/src/endpoints_handlers/IExecutor.h
T

38 lines
1.0 KiB
C++

#pragma once
#include <boost/beast.hpp>
namespace uad
{
template <class Body, class Allocator, class ResponseType>
class IExecutor
{
public:
virtual boost::beast::http::response<ResponseType> operator ()(
boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
) = 0;
virtual ~IExecutor() = default;
};
// class IAuthorizable : public IExecutor
// {
// IExecutor& next_executor_;
// public:
// IAuthorizable(IExecutor& next_executor): next_executor_(next_executor)
// {
//
// }
//
// boost::beast::http::response<ResponseType> operator ()(
// boost::beast::http::request<Body, boost::beast::http::basic_fields<Allocator>>&& req
// ) override
// {
// // Логика проверки авторизации
// // передать управление следующему executorу - возврат req
// // посмотреть chain of responsibility, composite
// // выбрасывать исключение здесь
// return next_executor_(req);
// }
// };
}